diff options
| author | Japa | 2010-05-12 10:57:41 +0000 |
|---|---|---|
| committer | Japa | 2010-05-12 10:57:41 +0000 |
| commit | 4973b0360e04a75ea9aed468547f18458dcb8a99 (patch) | |
| tree | 57a2813463ee9e5cb31fdba9c8984db46fa03fe1 /CreatureConfiguration.cpp | |
| parent | c519d1f44bf676fa4bc45323348555309183f253 (diff) | |
| download | stonesense-4973b0360e04a75ea9aed468547f18458dcb8a99.tar.gz stonesense-4973b0360e04a75ea9aed468547f18458dcb8a99.tar.bz2 stonesense-4973b0360e04a75ea9aed468547f18458dcb8a99.tar.xz | |
forgot to add some files
Diffstat (limited to 'CreatureConfiguration.cpp')
| -rw-r--r-- | CreatureConfiguration.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/CreatureConfiguration.cpp b/CreatureConfiguration.cpp index 5506fd9..a507717 100644 --- a/CreatureConfiguration.cpp +++ b/CreatureConfiguration.cpp @@ -185,11 +185,10 @@ bool addSingleCreatureConfig( TiXmlElement* elemCreature, vector<vector<Creature //do bodyparts
const char* bodyVarPartStr = elemVariant->Attribute("bodypart");
- if (bodyVarPartStr == NULL || bodyVarPartStr[0] == 0)
- {
- for(int i = 0; i < 128; i++)sprite.bodyPart[i] = 0;
- }
- else
+ //clear old bodypart string
+ memset(sprite.bodyPart, 0, sizeof(sprite.bodyPart));
+ //copy new, if found
+ if (bodyVarPartStr != NULL && bodyVarPartStr[0] != 0)
{
strcpy(sprite.bodyPart, bodyVarPartStr);
}
@@ -217,11 +216,10 @@ bool addSingleCreatureConfig( TiXmlElement* elemCreature, vector<vector<Creature }
//do bodyparts
const char* bodyPartStr = elemCreature->Attribute("bodypart");
- if (bodyPartStr == NULL || bodyPartStr[0] == 0)
- {
- for(int i = 0; i < 128; i++)sprite.bodyPart[i] = 0;
- }
- else
+ //clear old bodypart string
+ memset(sprite.bodyPart, 0, sizeof(sprite.bodyPart));
+ //copy new, if found
+ if (bodyPartStr != NULL && bodyPartStr[0] != 0)
{
strcpy(sprite.bodyPart, bodyPartStr);
}
|
