Skip to content

Commit

Permalink
fix graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed May 18, 2024
1 parent c3f20db commit c147bf9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,17 @@ bool level_is_same_type(Levelp l, int x, int y, int z, Tpp tp)
return false;
}

auto id = l->thing_id[ x ][ y ][ z ][ tp_z_depth_get(tp) ];
if (! id) {
return false;
for (auto slot = 0; slot < MAP_SLOTS; slot++) {
Tpp it_tp;
Thingp it = level_thing_and_tp_get(l, x, y, z, slot, &it_tp);
if (! it) {
continue;
}
if (it_tp == tp) {
return true;
}
}

return id == tp_id_get(tp);
return false;
}

void level_bounds_set(Levelp l)
Expand Down
1 change: 1 addition & 0 deletions src/level_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ static void level_display_obj(Levelp l, int x, int y, Tpp tp, Thingp t, bool dec
}

if (deco) {
return;
tile_index += 47;
}

Expand Down
2 changes: 1 addition & 1 deletion src/level_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void level_assign_tiles(Levelp l, int z)
auto which = std::string(tile_name) + "." + is_join_enum_val2str((is_join_enum) block_type);
auto tile = tile_find_mand(which.c_str());
if (tile) {
t->tile_index = tile_index(tile);
t->tile_index = tile_global_index(tile);
t->anim_index = pcg_random_range_inclusive(0, tp_tiles_size(tp) - 1);
t->anim_ms_remaining = pcg_random_range_inclusive(0, tile_delay_ms(tile));
}
Expand Down
2 changes: 1 addition & 1 deletion src/tp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Tp
bool is_able_to_walk_through_walls {};
// end sort marker1 }

uint8_t flag[ THING_FLAG_MAX ];
uint8_t flag[ THING_FLAG_MAX ] = {};

// begin sort marker2 {
int chance_d1000_appearing {};
Expand Down

0 comments on commit c147bf9

Please sign in to comment.