Use structured bindings for map k,v pairs. Place counters for for range iterator loops locally inside their scopes.

pull/28/head
sigonasr2 1 year ago
parent 6d4f024d3c
commit 30287c91d2
  1. 3
      Crawler/CharacterMenuWindow.cpp
  2. 36
      Crawler/Crawler.cpp
  3. 59
      Crawler/Item.cpp
  4. 76
      Crawler/Menu.cpp
  5. 3
      Crawler/TMXParser.h
  6. 12
      Crawler/Test.cpp
  7. 2
      Crawler/Version.h

@ -123,8 +123,7 @@ void Menu::InitializeCharacterMenuWindow(){
ScrollableWindowComponent*equipList=Component<ScrollableWindowComponent>(data.component->parentMenu,"Equip List"); ScrollableWindowComponent*equipList=Component<ScrollableWindowComponent>(data.component->parentMenu,"Equip List");
equipList->RemoveAllComponents(); equipList->RemoveAllComponents();
int counter=0; for(int counter=0;Item&it:availableEquipment){
for(Item&it:availableEquipment){
float xOffset=(counter%3)*26; float xOffset=(counter%3)*26;
Item&itemInvRef=Inventory::GetItem(it.Name()); Item&itemInvRef=Inventory::GetItem(it.Name());
MenuItemItemButton*equip=NEW MenuItemItemButton(CHARACTER_MENU,{{2+xOffset,2},{24,24}},itemInvRef,MenuType::ENUM_END,[](MenuFuncData data){ MenuItemItemButton*equip=NEW MenuItemItemButton(CHARACTER_MENU,{{2+xOffset,2},{24,24}},itemInvRef,MenuType::ENUM_END,[](MenuFuncData data){

@ -126,8 +126,8 @@ Crawler::Crawler()
std::string ITEM_SET_CONFIG = CONFIG_PATH + "item_set_config"_S; std::string ITEM_SET_CONFIG = CONFIG_PATH + "item_set_config"_S;
utils::datafile::Read(DATA,ITEM_SET_CONFIG); utils::datafile::Read(DATA,ITEM_SET_CONFIG);
for(auto&key:DATA.GetProperty("ItemConfiguration").GetKeys()){ for(auto&[key,value]:DATA.GetProperty("ItemConfiguration").GetKeys()){
std::string config = DATA["ItemConfiguration"][key.first].GetString(); std::string config = DATA["ItemConfiguration"][key].GetString();
utils::datafile::Read(DATA,CONFIG_PATH + "item_directory"_S + config); utils::datafile::Read(DATA,CONFIG_PATH + "item_directory"_S + config);
} }
@ -1436,8 +1436,8 @@ void Crawler::LoadLevel(MapName map){
Inventory::Clear("Stage Loot"); Inventory::Clear("Stage Loot");
#pragma region Monster Spawn Data Setup #pragma region Monster Spawn Data Setup
for(auto&key:MAP_DATA[map].SpawnerData){ for(auto&[key,value]:MAP_DATA[map].SpawnerData){
SpawnerTag&spawnData=MAP_DATA[map].SpawnerData[key.first]; SpawnerTag&spawnData=MAP_DATA[map].SpawnerData[key];
std::vector<std::pair<int,vf2d>>monster_list; std::vector<std::pair<int,vf2d>>monster_list;
vf2d spawnerRadius=vf2d{spawnData.ObjectData.GetFloat("width"),spawnData.ObjectData.GetFloat("height")}/2; vf2d spawnerRadius=vf2d{spawnData.ObjectData.GetFloat("width"),spawnData.ObjectData.GetFloat("height")}/2;
@ -1565,9 +1565,8 @@ void Crawler::LoadLevel(MapName map){
#pragma endregion #pragma endregion
#pragma region Bridge Layer Setup #pragma region Bridge Layer Setup
int counter=0;
bridgeLayerIndex=-1; bridgeLayerIndex=-1;
for(LayerTag&layer:MAP_DATA[map].LayerData){ for(int counter=0;LayerTag&layer:MAP_DATA[map].LayerData){
if(IsBridgeLayer(layer)){ if(IsBridgeLayer(layer)){
bridgeLayerIndex=counter; bridgeLayerIndex=counter;
} }
@ -1644,9 +1643,8 @@ geom2d::rect<int>Crawler::GetTileCollision(MapName map,vf2d pos,bool upperLevel)
return NO_COLLISION; return NO_COLLISION;
} }
} }
int counter=0;
geom2d::rect<int>foundRect=NO_COLLISION; geom2d::rect<int>foundRect=NO_COLLISION;
for(LayerTag&layer:MAP_DATA[map].LayerData){ for(int counter=0;LayerTag&layer:MAP_DATA[map].LayerData){
//auto HasNoClass=[&](){return layer.tag.data.find("class")==layer.tag.data.end();}; //auto HasNoClass=[&](){return layer.tag.data.find("class")==layer.tag.data.end();};
if(counter!=bridgeLayerIndex){ if(counter!=bridgeLayerIndex){
int tileID=layer.tiles[int(pos.y)/game->GetCurrentMap().tilewidth][int(pos.x)/game->GetCurrentMap().tilewidth]-1; int tileID=layer.tiles[int(pos.y)/game->GetCurrentMap().tilewidth][int(pos.x)/game->GetCurrentMap().tilewidth]-1;
@ -1868,21 +1866,21 @@ bool Crawler::IsReflectiveTile(TilesheetData tileSheet,int tileID){
bool Crawler::OnUserDestroy(){ bool Crawler::OnUserDestroy(){
GFX.Reset(); GFX.Reset();
for(auto&data:MAP_DATA){ for(auto&[key,value]:MAP_DATA){
if(MAP_DATA[data.first].optimizedTile!=nullptr){ if(MAP_DATA[key].optimizedTile!=nullptr){
delete MAP_DATA[data.first].optimizedTile; delete MAP_DATA[key].optimizedTile;
} }
} }
for(auto&key:MAP_TILESETS){ for(auto&[key,value]:MAP_TILESETS){
delete key.second.tileset; delete value.tileset;
} }
for(auto&data:GameState::states){ for(auto&[key,value]:GameState::states){
delete data.second; delete value;
} }
delete[]pathfinder.nodes; delete[]pathfinder.nodes;
Menu::CleanupAllMenus(); Menu::CleanupAllMenus();
for(auto&key:MonsterData::imgs){ for(auto&[key,value]:MonsterData::imgs){
delete key.second; delete value;
} }
return true; return true;
} }
@ -2049,8 +2047,8 @@ void Crawler::InitializeGraphics(){
mappedKeys.push_back(key); mappedKeys.push_back(key);
} }
std::sort(mappedKeys.begin(),mappedKeys.end(),[](std::pair<std::string,size_t>&key1,std::pair<std::string,size_t>&key2){return key1.second<key2.second;}); std::sort(mappedKeys.begin(),mappedKeys.end(),[](std::pair<std::string,size_t>&key1,std::pair<std::string,size_t>&key2){return key1.second<key2.second;});
for(auto&key:mappedKeys){ for(auto&[key,value]:mappedKeys){
std::string themeName=key.first; std::string themeName=key;
std::string imgPath=DATA["Themes"][themeName]["filename"].GetString(); std::string imgPath=DATA["Themes"][themeName]["filename"].GetString();
Renderable&img=GFX["theme_img_directory"_S+imgPath+".png"]; Renderable&img=GFX["theme_img_directory"_S+imgPath+".png"];
img.Load("GFX_Prefix"_S+"theme_img_directory"_S+imgPath+".png"); img.Load("GFX_Prefix"_S+"theme_img_directory"_S+imgPath+".png");

@ -82,16 +82,16 @@ void ItemInfo::InitializeItems(){
InitializeSets(); InitializeSets();
for(auto&key:DATA["ItemCategory"].GetKeys()){ for(auto&[key,value]:DATA["ItemCategory"].GetKeys()){
ITEM_CATEGORIES[key.first]; ITEM_CATEGORIES[key];
Inventory::sortedInv[key.first]; Inventory::sortedInv[key];
Menu::inventoryListeners[key.first]; Menu::inventoryListeners[key];
} }
auto ReadItems=[&](datafile&data){ auto ReadItems=[&](datafile&data){
for(auto&key:data.GetKeys()){ for(auto&[key,value]:data.GetKeys()){
std::string imgPath="assets/"+"item_img_directory"_S+key.first+".png"; std::string imgPath="assets/"+"item_img_directory"_S+key+".png";
Renderable&img=GFX["item_img_directory"_S+key.first+".png"]; Renderable&img=GFX["item_img_directory"_S+key+".png"];
img.Load(imgPath); img.Load(imgPath);
std::string scriptName="",description="",category=""; std::string scriptName="",description="",category="";
@ -100,45 +100,45 @@ void ItemInfo::InitializeItems(){
std::vector<std::string> slot; std::vector<std::string> slot;
float cooldownTime="Item.Item Cooldown Time"_F; float cooldownTime="Item.Item Cooldown Time"_F;
std::vector<ItemAttribute>statValueList; std::vector<ItemAttribute>statValueList;
for(auto&itemKey:data[key.first].GetKeys()){ for(auto&[itemKey,itemValue]:data[key].GetKeys()){
std::string keyName=itemKey.first; std::string keyName=itemKey;
if(keyName=="Description"){ if(keyName=="Description"){
description=data[key.first][keyName].GetString(); description=data[key][keyName].GetString();
}else }else
if(keyName=="ItemCategory"){ if(keyName=="ItemCategory"){
category=data[key.first][keyName].GetString(); category=data[key][keyName].GetString();
}else }else
if(keyName=="ItemScript"){ if(keyName=="ItemScript"){
scriptName=data[key.first][keyName].GetString(); scriptName=data[key][keyName].GetString();
}else }else
if(keyName=="Cast Time"){ if(keyName=="Cast Time"){
castTime=float(data[key.first][keyName].GetReal()); castTime=float(data[key][keyName].GetReal());
}else }else
if(keyName=="Cooldown Time"){ if(keyName=="Cooldown Time"){
castTime=float(data[key.first][keyName].GetReal()); castTime=float(data[key][keyName].GetReal());
}else }else
if(keyName=="Slot"){ if(keyName=="Slot"){
for(auto&val:data[key.first][keyName].GetValues()){ for(auto&val:data[key][keyName].GetValues()){
slot.push_back(val); slot.push_back(val);
} }
}else }else
if(keyName=="StatValues"){ if(keyName=="StatValues"){
for(int i=0;i<data[key.first]["StatValues"].GetValueCount();i++){ for(int i=0;i<data[key]["StatValues"].GetValueCount();i++){
statValueList.push_back(ItemAttributable::GetAttributeFromString(data[key.first]["StatValues"].GetString(i))); statValueList.push_back(ItemAttributable::GetAttributeFromString(data[key]["StatValues"].GetString(i)));
} }
}else }else
if(keyName=="PartofSet"){ if(keyName=="PartofSet"){
setName=data[key.first][keyName].GetString(); setName=data[key][keyName].GetString();
}else{ //THis is a custom override modifier for a script. NO-OP }else{ //THis is a custom override modifier for a script. NO-OP
} }
} }
ItemInfo&it=ITEM_DATA[key.first]; ItemInfo&it=ITEM_DATA[key];
if(statValueList.size()>0){ if(statValueList.size()>0){
EnhancementInfo enhancementStats; EnhancementInfo enhancementStats;
for(int enhancementLevel=0;enhancementLevel<=10;enhancementLevel++){ for(int enhancementLevel=0;enhancementLevel<=10;enhancementLevel++){
datafile&dat=data[key.first]["StatValues["+std::to_string(enhancementLevel)+"]"]; datafile&dat=data[key]["StatValues["+std::to_string(enhancementLevel)+"]"];
int attrIndex=0; int attrIndex=0;
for(ItemAttribute&attr:statValueList){ for(ItemAttribute&attr:statValueList){
enhancementStats.SetAttribute(enhancementLevel,attr,dat.GetInt(attrIndex)); enhancementStats.SetAttribute(enhancementLevel,attr,dat.GetInt(attrIndex));
@ -149,11 +149,11 @@ void ItemInfo::InitializeItems(){
} }
if(scriptName!=""){ if(scriptName!=""){
if(!ITEM_SCRIPTS.count(scriptName)){ if(!ITEM_SCRIPTS.count(scriptName)){
ERR("Could not load script "<<scriptName<<" for Item "<<key.first<<"!") ERR("Could not load script "<<scriptName<<" for Item "<<key<<"!")
} }
} }
it.name=key.first; it.name=key;
it.description=description; it.description=description;
it.category=category; it.category=category;
it.castTime=castTime; it.castTime=castTime;
@ -174,7 +174,7 @@ void ItemInfo::InitializeItems(){
ItemProps&props=it.customProps; ItemProps&props=it.customProps;
if(scriptName!=""){ if(scriptName!=""){
props.scriptProps=&DATA["ItemScript"][scriptName]; props.scriptProps=&DATA["ItemScript"][scriptName];
props.customProps=&data[key.first]; props.customProps=&data[key];
} }
it.useFunc=scriptName; it.useFunc=scriptName;
} }
@ -432,9 +432,8 @@ void ItemOverlay::Update(){
} }
void ItemOverlay::Draw(){ void ItemOverlay::Draw(){
int counter=0;
float itemScale="ItemDrop.Item Drop Scale"_F; float itemScale="ItemDrop.Item Drop Scale"_F;
for(ItemOverlay&item:items){ for(int counter=0;ItemOverlay&item:items){
vf2d pos={item.xOffset,96.f+counter*10}; vf2d pos={item.xOffset,96.f+counter*10};
Pixel darkCol=Menu::GetCurrentTheme().GetButtonCol(); Pixel darkCol=Menu::GetCurrentTheme().GetButtonCol();
Pixel lightCol=Menu::GetCurrentTheme().GetButtonCol()*1.2f; Pixel lightCol=Menu::GetCurrentTheme().GetButtonCol()*1.2f;
@ -530,17 +529,17 @@ void EnhancementInfo::SetAttribute(int enhanceLevel,ItemAttribute attribute,int
} }
void ItemInfo::InitializeSets(){ void ItemInfo::InitializeSets(){
for(auto&key:DATA["ItemSet"].GetKeys()){ for(auto&[key,value]:DATA["ItemSet"].GetKeys()){
std::string setName=key.first; std::string setName=key;
datafile&setInfo=DATA["ItemSet"][setName]; datafile&setInfo=DATA["ItemSet"][setName];
for(int pieceCount=1;pieceCount<=8;pieceCount++){ for(int pieceCount=1;pieceCount<=8;pieceCount++){
if(setInfo.HasProperty(std::to_string(pieceCount))){ if(setInfo.HasProperty(std::to_string(pieceCount))){
datafile&statInfo=setInfo[std::to_string(pieceCount)]; datafile&statInfo=setInfo[std::to_string(pieceCount)];
Stats bonuses; Stats bonuses;
for(auto&key:statInfo.GetKeys()){ for(auto&[key,value]:statInfo.GetKeys()){
ItemAttribute attr=bonuses.GetAttributeFromString(key.first); ItemAttribute attr=bonuses.GetAttributeFromString(key);
bonuses.A(attr)=statInfo[key.first].GetInt(0); bonuses.A(attr)=statInfo[key].GetInt(0);
} }
ItemSet::AddSetBonus(setName,pieceCount,bonuses); ItemSet::AddSetBonus(setName,pieceCount,bonuses);
} }

@ -79,8 +79,8 @@ Menu::Menu(vf2d pos,vf2d size)
} }
Menu::~Menu(){ Menu::~Menu(){
for(auto&key:components){ for(auto&[key,value]:components){
delete key.second; delete value;
} }
} }
@ -105,8 +105,8 @@ void Menu::InitializeMenus(){
//Lock up everything once it's done. //Lock up everything once it's done.
menus[type]->buttons.SetInitialized(); menus[type]->buttons.SetInitialized();
menus[type]->keyboardButtons.SetInitialized(); menus[type]->keyboardButtons.SetInitialized();
for(auto&key:menus[type]->components){ for(auto&[key,value]:menus[type]->components){
MenuComponent*component=key.second; MenuComponent*component=value;
component->AfterCreate(); component->AfterCreate();
} }
} }
@ -218,8 +218,8 @@ void Menu::Update(Crawler*game){
SetMouseNavigation(true); SetMouseNavigation(true);
} }
for(auto&key:buttons){ for(auto&[key,value]:buttons){
for(auto&button:key.second){ for(auto&button:value){
if(!button->disabled){ if(!button->disabled){
button->hovered=false; button->hovered=false;
} }
@ -235,14 +235,14 @@ void Menu::Update(Crawler*game){
} }
}else{ }else{
selection={-1,-1}; selection={-1,-1};
for(auto&key:buttons){ for(auto&[key,value]:buttons){
int index=0; int index=0;
for(auto&button:key.second){ for(auto&button:value){
if(!button->disabled){ if(!button->disabled){
if(button->GetHoverState(game)){ if(button->GetHoverState(game)){
button->hovered=true; button->hovered=true;
itemHovered=true; itemHovered=true;
selection.y=key.first; selection.y=key;
selection.x=index; selection.x=index;
} }
} }
@ -291,8 +291,8 @@ void Menu::Update(Crawler*game){
} }
KeyboardButtonNavigation(game,pos); KeyboardButtonNavigation(game,pos);
for(auto&key:buttons){ for(auto&[key,value]:buttons){
for(auto&button:key.second){ for(auto&button:value){
if(button->renderInMain){ if(button->renderInMain){
button->_Update(game); button->_Update(game);
} }
@ -321,8 +321,8 @@ void Menu::Draw(Crawler*game){
component->_Draw(game); component->_Draw(game);
} }
} }
for(auto&key:buttons){ for(auto&[key,value]:buttons){
for(auto&button:key.second){ for(auto&button:value){
if(button->renderInMain){ if(button->renderInMain){
button->_Draw(game); button->_Draw(game);
} }
@ -337,8 +337,8 @@ void Menu::Draw(Crawler*game){
component->_DrawDecal(game,this==Menu::stack.back()); component->_DrawDecal(game,this==Menu::stack.back());
} }
} }
for(auto&key:buttons){ for(auto&[key,value]:buttons){
for(auto&button:key.second){ for(auto&button:value){
if(button->renderInMain){ if(button->renderInMain){
button->_DrawDecal(game,this==Menu::stack.back()); button->_DrawDecal(game,this==Menu::stack.back());
} }
@ -409,17 +409,17 @@ void Menu::KeyboardButtonNavigation(Crawler*game,vf2d menuPos){
bool selectedItem=false; bool selectedItem=false;
if(selection==vi2d{-1,-1}){ if(selection==vi2d{-1,-1}){
//Highlight first item. //Highlight first item.
for(auto&key:keyboardButtons){ for(auto&[key,value]:keyboardButtons){
selection.y=key.first; selection.y=key;
break; break;
} }
}else{ }else{
for(auto&key:keyboardButtons){ for(auto&[key,value]:keyboardButtons){
if(found){ //Once we discover the previous element, the next element becomes our next selection. if(found){ //Once we discover the previous element, the next element becomes our next selection.
int previousButtonX=int(keyboardButtons[selection.y][selection.x]->rect.pos.x); int previousButtonX=int(keyboardButtons[selection.y][selection.x]->rect.pos.x);
selection.y=key.first; selection.y=key;
int index=0; int index=0;
for(auto&button:key.second){ //Try to match a button in the same column as this button first. for(auto&button:value){ //Try to match a button in the same column as this button first.
if(previousButtonX==button->rect.pos.x){ if(previousButtonX==button->rect.pos.x){
selection.x=index; selection.x=index;
break; break;
@ -429,15 +429,15 @@ void Menu::KeyboardButtonNavigation(Crawler*game,vf2d menuPos){
selectedItem=true; selectedItem=true;
break; break;
} }
if(key.first==selection.y if(key==selection.y
//It's entirely possible this button was selected from the button selection list and may be out-of-bounds here. //It's entirely possible this button was selected from the button selection list and may be out-of-bounds here.
&&selection.x>=0&&selection.x<keyboardButtons[selection.y].size()){ &&selection.x>=0&&selection.x<keyboardButtons[selection.y].size()){
found=true; found=true;
} }
} }
if(!selectedItem){ //This means we need to loop around instead and pick the first one. if(!selectedItem){ //This means we need to loop around instead and pick the first one.
for(auto&key:keyboardButtons){ for(auto&[key,value]:keyboardButtons){
selection.y=key.first; selection.y=key;
break; break;
} }
} }
@ -447,18 +447,18 @@ void Menu::KeyboardButtonNavigation(Crawler*game,vf2d menuPos){
SetMouseNavigation(false); SetMouseNavigation(false);
if(selection==vi2d{-1,-1}){ if(selection==vi2d{-1,-1}){
//Highlight last item. //Highlight last item.
for(auto&key:keyboardButtons){ for(auto&[key,value]:keyboardButtons){
selection.y=key.first; selection.y=key;
} }
}else{ }else{
int prevInd=-1; int prevInd=-1;
for(auto&key:keyboardButtons){ for(auto&[key,value]:keyboardButtons){
if(key.first==selection.y&& if(key==selection.y&&
//It's entirely possible this button was selected from the button selection list and may be out-of-bounds here. //It's entirely possible this button was selected from the button selection list and may be out-of-bounds here.
selection.x>=0&&selection.x<keyboardButtons[selection.y].size()){ selection.x>=0&&selection.x<keyboardButtons[selection.y].size()){
break; break;
} }
prevInd=key.first; prevInd=key;
} }
if(prevInd!=-1){ if(prevInd!=-1){
int previousButtonX=int(keyboardButtons[selection.y][selection.x]->rect.pos.x); int previousButtonX=int(keyboardButtons[selection.y][selection.x]->rect.pos.x);
@ -473,8 +473,8 @@ void Menu::KeyboardButtonNavigation(Crawler*game,vf2d menuPos){
} }
}else{ //Since we didn't find it, it means we're at the top of the list or the list is empty. Go to the last element and use that one. }else{ //Since we didn't find it, it means we're at the top of the list or the list is empty. Go to the last element and use that one.
int lastInd=-1; int lastInd=-1;
for(auto&key:keyboardButtons){ for(auto&[key,value]:keyboardButtons){
lastInd=key.first; lastInd=key;
} }
selection.y=lastInd; selection.y=lastInd;
} }
@ -495,9 +495,9 @@ void Menu::KeyboardButtonNavigation(Crawler*game,vf2d menuPos){
if(selection==vi2d{-1,-1}&&buttons.size()>0){ if(selection==vi2d{-1,-1}&&buttons.size()>0){
//Find the first possible button entry in the map... //Find the first possible button entry in the map...
int firstInd=-1; int firstInd=-1;
for(auto&key:buttons){ for(auto&[key,value]:buttons){
if(buttons[key.first].size()>0){ if(buttons[key].size()>0){
firstInd=key.first; firstInd=key;
break; break;
} }
} }
@ -507,12 +507,12 @@ void Menu::KeyboardButtonNavigation(Crawler*game,vf2d menuPos){
} }
}else{//Mouse click. }else{//Mouse click.
selection={-1,-1}; selection={-1,-1};
for(auto&key:buttons){ for(auto&[key,value]:buttons){
int index=0; int index=0;
for(auto&button:key.second){ for(auto&button:value){
if(!button->disabled){ if(!button->disabled){
if(geom2d::overlaps(geom2d::rect<float>{button->rect.pos+menuPos,button->rect.size},game->GetMousePos())){ if(geom2d::overlaps(geom2d::rect<float>{button->rect.pos+menuPos,button->rect.size},game->GetMousePos())){
selection={index,key.first}; selection={index,key};
break; break;
} }
} }
@ -692,8 +692,8 @@ bool Menu::IsMenuOpen(){
} }
void Menu::CleanupAllMenus(){ void Menu::CleanupAllMenus(){
for(auto&key:Menu::menus){ for(auto&[key,value]:Menu::menus){
Menu*menu=key.second; Menu*menu=value;
for(auto&componentKey:menu->components){ for(auto&componentKey:menu->components){
MenuComponent*component=componentKey.second; MenuComponent*component=componentKey.second;
component->Cleanup(); component->Cleanup();

@ -470,8 +470,7 @@ class TMXParser{
} }
} }
} }
int counter=0; for(int counter=0;ConnectionPoint&connection:State_OverworldMap::connections){
for(ConnectionPoint&connection:State_OverworldMap::connections){
for(int val:connection.neighbors){ for(int val:connection.neighbors){
if(val!=-1){ if(val!=-1){
ConnectionPoint&neighbor=State_OverworldMap::connections.at(val); ConnectionPoint&neighbor=State_OverworldMap::connections.at(val);

@ -56,12 +56,12 @@ void Test::RunMapTests(){
is("There are two LowerBridgeCollision zones in Campaign I-I", is("There are two LowerBridgeCollision zones in Campaign I-I",
game->MAP_DATA.at(CAMPAIGN_1_1).ZoneData.count("LowerBridgeCollision") game->MAP_DATA.at(CAMPAIGN_1_1).ZoneData.count("LowerBridgeCollision")
&&game->MAP_DATA.at(CAMPAIGN_1_1).ZoneData.at("LowerBridgeCollision").size()>=2); &&game->MAP_DATA.at(CAMPAIGN_1_1).ZoneData.at("LowerBridgeCollision").size()>=2);
for(auto&key:game->MAP_DATA){ for(auto&[key,value]:game->MAP_DATA){
is("A Map type has been selected for map "+std::to_string(key.first), is("A Map type has been selected for map "+std::to_string(key),
key.second.mapType!=""&&key.second.mapType!="Unspecified"); value.mapType!=""&&value.mapType!="Unspecified");
if(key.second.mapType=="Dungeon"){ if(value.mapType=="Dungeon"){
is("There is an EndZone in Dungeon "+std::to_string(key.first), is("There is an EndZone in Dungeon "+std::to_string(key),
key.second.ZoneData.count("EndZone")); value.ZoneData.count("EndZone"));
} }
} }
} }

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 1 #define VERSION_PATCH 1
#define VERSION_BUILD 3470 #define VERSION_BUILD 3471
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save