]> git.jsancho.org Git - lugaru.git/commitdiff
Moved clothes boolean to PersonType to avoid test on rabbittype
authorCôme Chilliet <come@chilliet.eu>
Fri, 18 Aug 2017 23:23:23 +0000 (01:23 +0200)
committerCôme Chilliet <come@chilliet.eu>
Fri, 18 Aug 2017 23:23:23 +0000 (01:23 +0200)
Source/GameTick.cpp
Source/Objects/Person.cpp
Source/Objects/Person.hpp
Source/Objects/PersonType.cpp
Source/Objects/PersonType.hpp

index 9994747a02b47eedb806697d27e141eb94a50412..c7075da3fbb2cb6055c4ccfab697a9ad1709cef5 100644 (file)
@@ -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;
index ff699a1cae6109729496d30d7a3f06130250d029..01b9f903e98631d2f568c20b96b98ce20003d47c 100644 (file)
@@ -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);
 }
index beaf11c17873f35e3b961953d507b463c48a6911..0bacf772b21744eda7de9d07be2b197c83d02e8b 100644 (file)
@@ -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]]; }
index 3dd392842d63bc2edbf5b604dc12bcbe2285f46b..521a02cf2bf956fc8f8e50713e2a71a87af69ad9 100644 (file)
@@ -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;
 }
index e39e4548472b1eae403e623d27ba3791bef61d9c..512b8a8be854e2388503e9ce4b150db700bc046b 100644 (file)
@@ -61,6 +61,7 @@ public:
     unsigned int defaultDamageTolerance;
     float defaultScale;
     bool hasClaws;
+    bool clothes;
 
     GLubyte bloodText[512 * 512 * 3] = { 0 };