diff --git a/achievement.cpp b/achievement.cpp index ba700440..21d2e79c 100644 --- a/achievement.cpp +++ b/achievement.cpp @@ -109,7 +109,7 @@ EX bool wrongMode(char flags) { if(casual) return true; if(flags == rg::global) return false; - if(flags != rg::special_geometry) { + if(flags != rg::special_geometry && flags != rg::special_geometry_nicewalls) { if(!BITRUNCATED) return true; if(geometry != gNormal) return true; } @@ -128,12 +128,13 @@ EX bool wrongMode(char flags) { #if CAP_TOUR if(tour::on) return true; #endif - if(flags == rg::special_geometry && !ls::single()) - return true; - if(flags != rg::special_geometry && ineligible_starting_land) - return true; - if(flags == rg::chaos && !ls::std_chaos()) return true; - if(flags != rg::chaos && flags != rg::special_geometry && !ls::nice_walls()) return true; + eLandStructure dls = lsNiceWalls; + if(flags == rg::special_geometry || flags == rg::racing || flags == rg::princess) + dls = lsSingle; + if(flags == rg::chaos) + dls = lsChaos; + + if(land_structure != dls) return true; if((numplayers() > 1) != (flags == rg::multi)) return true; return false; } diff --git a/complex.cpp b/complex.cpp index c7551c62..6790f910 100644 --- a/complex.cpp +++ b/complex.cpp @@ -643,7 +643,7 @@ struct info { } if(newdist == OUT_OF_PRISON && princess::challenge) { addMessage(XLAT("Congratulations! Your score is %1.", its(i->value))); - achievement_gain_once("PRINCESS2"); + achievement_gain_once("PRINCESS2", rg::princess); if(!cheater) achievement_score(36, i->value); LATE( showMissionScreen(); ) } diff --git a/legacy.cpp b/legacy.cpp index 06314b2b..975e1a4f 100644 --- a/legacy.cpp +++ b/legacy.cpp @@ -204,7 +204,15 @@ int modecodetable[42][6] = { EX modecode_t legacy_modecode() { if(int(geometry) > 3 || int(variation) > 1) return UNKNOWN; - if(!ls::nice_walls() && !ls::std_chaos() && !yendor::on && !tactic::on) return UNKNOWN; + + bool is_default_land_structure = + (princess::challenge || tactic::on) ? ls::single() : + racing::on ? (land_structure == lsSingle) : + yendor::on ? (land_structure == yendor::get_land_structure()) : + ls::nice_walls(); + + if(!is_default_land_structure && !ls::std_chaos()) return UNKNOWN; + // compute the old code int xcode = 0; @@ -219,7 +227,7 @@ EX modecode_t legacy_modecode() { if(elliptic) xcode += 6; } - if(ls::any_chaos()) xcode += 21; + if(ls::any_chaos() && !yendor::on) xcode += 21; int np = numplayers()-1; if(np<0 || np>5) np=5; diff --git a/system.cpp b/system.cpp index 8408a85d..a968cca2 100644 --- a/system.cpp +++ b/system.cpp @@ -31,8 +31,10 @@ namespace rg { static const char global = 'x'; /** \brief wrongmode only -- change vid.scfg.players then restart_game(rg::nothing) instead */ static const char multi = 'm'; - /** \brief wrongmode only -- mark achievements for special geometries/variations */ + /** \brief wrongmode only -- mark achievements for special geometries/variations, this automatically marks the expected land_structure as lsSingle */ static const char special_geometry = 'g'; + /** \brief wrongmode only -- mark achievements for special geometries/variations */ + static const char special_geometry_nicewalls = 'G'; } #endif @@ -1495,7 +1497,7 @@ EX void switch_game_mode(char switchWhat) { peace::on = false; tour::on = false; inv::on = false; - land_structure = lsSingle; + land_structure = racing::on ? lsSingle : lsNiceWalls; princess::challenge = false; dual::disable(); break;