From: Côme Chilliet Date: Fri, 18 Aug 2017 23:23:23 +0000 (+0200) Subject: Moved clothes boolean to PersonType to avoid test on rabbittype X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=bb302fb1d9936b1ab630a800698ab7b867472a7d;p=lugaru.git Moved clothes boolean to PersonType to avoid test on rabbittype --- diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 9994747..c7075da 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -1432,7 +1432,7 @@ void Game::ProcessDevInput() Person::players.back()->howactive = editoractive; Person::players.back()->whichskin = (int)(abs(Random() % 3)); - Person::players.back()->skeletonLoad(true); + Person::players.back()->skeletonLoad(); Person::players.back()->skeleton.drawmodelclothes.textureptr.load("Textures/Belt.png", 1); Person::players.back()->speed = 1 + (float)(Random() % 100) / 1000; diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index ff699a1..01b9f90 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -441,12 +441,12 @@ void Person::changeCreatureType(person_type type) { creature = type; whichskin = 0; - skeletonLoad(type == rabbittype); + skeletonLoad(); scale = PersonType::types[creature].defaultScale; damagetolerance = PersonType::types[creature].defaultDamageTolerance; } -void Person::skeletonLoad(bool clothes) +void Person::skeletonLoad() { skeleton.id = id; skeleton.Load( @@ -462,7 +462,7 @@ void Person::skeletonLoad(bool clothes) PersonType::types[creature].modelFileNames[6], PersonType::types[creature].lowModelFileName, PersonType::types[creature].modelClothesFileName, - clothes); + PersonType::types[creature].clothes); skeleton.drawmodel.textureptr.load(PersonType::types[creature].skins[whichskin], 1, &skeleton.skinText[0], &skeleton.skinsize); } diff --git a/Source/Objects/Person.hpp b/Source/Objects/Person.hpp index beaf11c..0bacf77 100644 --- a/Source/Objects/Person.hpp +++ b/Source/Objects/Person.hpp @@ -318,7 +318,7 @@ public: Person(); Person(FILE*, int, unsigned); - void skeletonLoad(bool clothes = false); + void skeletonLoad(); // convenience functions inline Joint& joint(int bodypart) { return skeleton.joints[skeleton.jointlabels[bodypart]]; } diff --git a/Source/Objects/PersonType.cpp b/Source/Objects/PersonType.cpp index 3dd3928..521a02c 100644 --- a/Source/Objects/PersonType.cpp +++ b/Source/Objects/PersonType.cpp @@ -79,6 +79,7 @@ void PersonType::Load() types[wolftype].defaultDamageTolerance = 300; types[wolftype].defaultScale = .23; types[wolftype].hasClaws = true; + types[wolftype].clothes = false; /* Rabbit */ types[rabbittype].proportions[0] = 1.2; @@ -133,4 +134,5 @@ void PersonType::Load() types[rabbittype].defaultDamageTolerance = 200; types[rabbittype].defaultScale = .2; types[rabbittype].hasClaws = false; + types[rabbittype].clothes = true; } diff --git a/Source/Objects/PersonType.hpp b/Source/Objects/PersonType.hpp index e39e454..512b8a8 100644 --- a/Source/Objects/PersonType.hpp +++ b/Source/Objects/PersonType.hpp @@ -61,6 +61,7 @@ public: unsigned int defaultDamageTolerance; float defaultScale; bool hasClaws; + bool clothes; GLubyte bloodText[512 * 512 * 3] = { 0 };