Skip to content

Commit d6e24d6

Browse files
authored
Merge pull request #833 from edgyaf/master
fix custom skin model id range
2 parents fc5b4c8 + fed6208 commit d6e24d6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

SDK/include/values.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ constexpr float MIN_WORLD_BOUNDS = -20000.0f;
5959
constexpr int MAX_TEXTDRAW_STR_LENGTH = 800;
6060
constexpr int MAX_VEHICLE_CARRIAGES = 3;
6161
constexpr int MAX_GAMETEXT_STYLES = 16;
62+
constexpr int MIN_CUSTOM_SKIN_ID = 20001;
63+
constexpr int MAX_CUSTOM_SKIN_ID = 30000;
64+
constexpr int MIN_CUSTOM_OBJECT_ID = -30000;
65+
constexpr int MAX_CUSTOM_OBJECT_ID = -1000;
6266

6367
enum Key
6468
{

Server/Components/CustomModels/models.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,9 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
589589
return false;
590590
}
591591

592-
if (type == ModelType::Skin && !(id >= 20000 && id <= 30000))
592+
if (type == ModelType::Skin && !(id >= MIN_CUSTOM_SKIN_ID && id <= MAX_CUSTOM_SKIN_ID))
593593
return false;
594-
else if (type == ModelType::Object && !(id >= -30000 && id <= -1000))
594+
else if (type == ModelType::Object && !(id >= MIN_CUSTOM_OBJECT_ID && id <= MAX_CUSTOM_OBJECT_ID))
595595
return false;
596596
else if (baseModels.find(id) != baseModels.end())
597597
{
@@ -648,7 +648,7 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
648648
{
649649
// Check if model is default one (base).
650650
// If so, there's no custom model to be returned.
651-
if (baseModelIdOrInput >= 0 && baseModelIdOrInput <= 20000)
651+
if (baseModelIdOrInput >= 0 && baseModelIdOrInput < MIN_CUSTOM_SKIN_ID)
652652
return false;
653653

654654
// Check if input is valid custom model.

0 commit comments

Comments
 (0)