Don't send designations in adventure mode

develop
Japa 2016-05-31 22:53:48 +05:30
parent 1e695ea308
commit b1072b65e4
1 changed files with 31 additions and 25 deletions

@ -101,6 +101,7 @@ using namespace df::global;
REQUIRE_GLOBAL(world); REQUIRE_GLOBAL(world);
REQUIRE_GLOBAL(gps); REQUIRE_GLOBAL(gps);
REQUIRE_GLOBAL(ui); REQUIRE_GLOBAL(ui);
REQUIRE_GLOBAL(gamemode);
#endif #endif
// Here go all the command declarations... // Here go all the command declarations...
@ -1171,32 +1172,37 @@ void CopyDesignation(df::map_block * DfBlock, RemoteFortressReader::MapBlock * N
NetBlock->add_subterranean(designation.bits.subterranean); NetBlock->add_subterranean(designation.bits.subterranean);
NetBlock->add_water_salt(designation.bits.water_salt); NetBlock->add_water_salt(designation.bits.water_salt);
NetBlock->add_water_stagnant(designation.bits.water_stagnant); NetBlock->add_water_stagnant(designation.bits.water_stagnant);
switch (designation.bits.dig) if(gamemode && (*gamemode == game_mode::ADVENTURE))
{
case df::enums::tile_dig_designation::No:
NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG);
break; else
case df::enums::tile_dig_designation::Default: {
NetBlock->add_tile_dig_designation(TileDigDesignation::DEFAULT_DIG); switch (designation.bits.dig)
break; {
case df::enums::tile_dig_designation::UpDownStair: case df::enums::tile_dig_designation::No:
NetBlock->add_tile_dig_designation(TileDigDesignation::UP_DOWN_STAIR_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG);
break; break;
case df::enums::tile_dig_designation::Channel: case df::enums::tile_dig_designation::Default:
NetBlock->add_tile_dig_designation(TileDigDesignation::CHANNEL_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::DEFAULT_DIG);
break; break;
case df::enums::tile_dig_designation::Ramp: case df::enums::tile_dig_designation::UpDownStair:
NetBlock->add_tile_dig_designation(TileDigDesignation::RAMP_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::UP_DOWN_STAIR_DIG);
break; break;
case df::enums::tile_dig_designation::DownStair: case df::enums::tile_dig_designation::Channel:
NetBlock->add_tile_dig_designation(TileDigDesignation::DOWN_STAIR_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::CHANNEL_DIG);
break; break;
case df::enums::tile_dig_designation::UpStair: case df::enums::tile_dig_designation::Ramp:
NetBlock->add_tile_dig_designation(TileDigDesignation::UP_STAIR_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::RAMP_DIG);
break; break;
default: case df::enums::tile_dig_designation::DownStair:
NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG); NetBlock->add_tile_dig_designation(TileDigDesignation::DOWN_STAIR_DIG);
break; break;
case df::enums::tile_dig_designation::UpStair:
NetBlock->add_tile_dig_designation(TileDigDesignation::UP_STAIR_DIG);
break;
default:
NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG);
break;
}
} }
} }
} }