Flipped logic for firstgid checking with multiple tile layers.

pull/28/head
sigonasr2 1 year ago
parent 2613a9ea33
commit 0294fdb8bc
  1. 4
      Crawler/Crawler.cpp
  2. 2
      Crawler/Version.h

@ -133,7 +133,7 @@ bool Crawler::OnUserCreate(){
,{MonsterName::SLIME_BLUE,{(rand()%20/2.f-5)*24,(rand()%20/2.f-5)*24}} ,{MonsterName::SLIME_BLUE,{(rand()%20/2.f-5)*24,(rand()%20/2.f-5)*24}}
}})); }}));
LoadLevel(CAMPAIGN_1_1); LoadLevel(LEVEL1);
return true; return true;
} }
@ -839,7 +839,7 @@ TilesheetData Crawler::GetTileSheet(MapName map,int tileID){
return {*MAP_TILESETS["assets/maps/"+tileData[0].data["source"]],1}; return {*MAP_TILESETS["assets/maps/"+tileData[0].data["source"]],1};
} else { } else {
for (int i=1;i<tileData.size();i++){ for (int i=1;i<tileData.size();i++){
if(stoi(tileData[i].data["firstgid"])<tileID){ if(tileID<stoi(tileData[i].data["firstgid"])){
return {*MAP_TILESETS["assets/maps/"+tileData[i-1].data["source"]],stoi(tileData[i-1].data["firstgid"])}; return {*MAP_TILESETS["assets/maps/"+tileData[i-1].data["source"]],stoi(tileData[i-1].data["firstgid"])};
} }
} }

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 155 #define VERSION_BUILD 157
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save