Flipped logic for firstgid checking with multiple tile layers.

This commit is contained in:
sigonasr2 2023-06-22 04:42:55 -07:00
parent 2613a9ea33
commit 0294fdb8bc
2 changed files with 3 additions and 3 deletions

View File

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

View File

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