summaryrefslogtreecommitdiff
path: root/Creatures.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2011-09-18 13:48:18 +0200
committerPetr Mrázek2011-09-18 13:48:18 +0200
commitc140ed8d6dbe05854ee1499540814d5f358a960a (patch)
tree2696fd7198a325e0d5264f0b87085f4f0a203b57 /Creatures.cpp
parent462f6f9767c0676c06b78ba2acab48a60a3963f5 (diff)
downloadstonesense-c140ed8d6dbe05854ee1499540814d5f358a960a.tar.gz
stonesense-c140ed8d6dbe05854ee1499540814d5f358a960a.tar.bz2
stonesense-c140ed8d6dbe05854ee1499540814d5f358a960a.tar.xz
stonesense changes required for Creatures module rewrite.
Diffstat (limited to 'Creatures.cpp')
-rw-r--r--Creatures.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Creatures.cpp b/Creatures.cpp
index 9091a04..64a48c2 100644
--- a/Creatures.cpp
+++ b/Creatures.cpp
@@ -351,6 +351,7 @@ void ReadCreaturesToSegment( DFHack::Core& DF, WorldSegment* segment)
if(z2<0) z2=0;
t_creature *tempcreature = new t_creature();
+ df_creature *unit_ptr = 0;
/*for (uint32_t index = 0; index < numcreatures ; index++)
{
Creatures->ReadCreature( index, *tempcreature );*/
@@ -359,8 +360,9 @@ void ReadCreaturesToSegment( DFHack::Core& DF, WorldSegment* segment)
{
try
{
- while((index = Creatures->ReadCreatureInBox( index, *tempcreature, x1,y1,z1,x2,y2,z2)) != -1 )
+ while((index = Creatures->GetCreatureInBox( index, &unit_ptr, x1,y1,z1,x2,y2,z2)) != -1 )
{
+ Creatures->CopyCreature(unit_ptr,*tempcreature);
index++;
if( IsCreatureVisible( tempcreature ) )
{
@@ -463,7 +465,7 @@ CreatureConfiguration *GetCreatureConfig( t_creature* c ){
// dont try to match strings until other tests pass
if( testConfig->professionstr[0])
{ //cant be NULL, so check has length
- creatureMatchesJob = (strcmp(testConfig->professionstr,c->custom_profession)==0);
+ creatureMatchesJob = (c->custom_profession == testConfig->professionstr);
}
if(!creatureMatchesJob) continue;