mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
Fix crash when editing map
This commit is contained in:
1 parent
f3f2f1d5e7
commit
042ea79d7b
1 file changed
+2
-2
Vendored
+2
-2
@@ -99,7 +99,7 @@ int main(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
state.game = GAME_SA1; // TODO: Load from settings.txt if it exists
|
||||
state.game = GAME_SA2; // TODO: Load from settings.txt if it exists
|
||||
|
||||
|
||||
// NOTE: We could just use "../../" for the check,
|
||||
@@ -545,7 +545,7 @@ SetNewMetatiles(AppState *state, int x, int y)
|
||||
StageMap *map = &state->map;
|
||||
short targetIndex = y * map->width + x;
|
||||
|
||||
if(targetIndex < (state->paths.map.tilemap.dataSize / (state->game == GAME_SA1) ? sizeof(unsigned char) : sizeof(short))) {
|
||||
if(targetIndex < (state->paths.map.tilemap.dataSize / ((state->game == GAME_SA1) ? sizeof(unsigned char) : sizeof(short)) )) {
|
||||
if(map->flags & MAP_FLAG_SHOW_BACK_LAYER) {
|
||||
if(state->game == GAME_SA1) {
|
||||
unsigned char *layoutBack = state->paths.map.layers[LAYER_BACK].data;
|
||||
|
||||
Reference in new issue
Block a user