Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Feb 25, 2024
1 parent 8c6c3bc commit 9be67d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/game_api/spawn_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,13 @@ Entity* spawn_entity(EntityFactory* entity_factory, std::uint32_t entity_type, f
// TODO: This still might not work very well and corner fill isn't actually floor spreading per level config definition, and should have a different SPAWN_TYPE (corner fill still happens when floor spreading chance is set to 0)
// const auto theme_floor = State::get().ptr_local()->current_theme->get_floor_spreading_type();
// const auto theme_floor2 = State::get().ptr_local()->current_theme->get_floor_spreading_type2();
auto state = State::get().ptr();
auto [ax, ay, bx, by] = std::make_tuple(2.5f, 122.5f, state->w * 10.0f + 2.5f, 122.5f - state->h * 8.0f);
static const auto border_octo = to_id("ENT_TYPE_FLOOR_BORDERTILE_OCTOPUS");
static const auto border_dust = to_id("ENT_TYPE_FLOOR_DUSTWALL");
const bool is_decorated = (entity_factory->types[entity_type].properties_flags & 0x1) == 0x1;
const bool is_styled = (entity_factory->types[entity_type].properties_flags & 0x2) == 0x2;
const bool is_border = entity_type <= border_octo || entity_type == border_dust;
const bool is_border = entity_type <= border_octo || entity_type == border_dust || x < ax || x > bx || y > ay || y < by;
const bool is_floor_spreading = (is_decorated || is_styled) && !is_border && (g_SpawnTypeFlags & SPAWN_TYPE_LEVEL_GEN) && !(g_SpawnTypeFlags & SPAWN_TYPE_LEVEL_GEN_TILE_CODE);
if (is_floor_spreading)
{
Expand Down
4 changes: 2 additions & 2 deletions src/game_api/vtable_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ void hook_vtable(T* obj, HookFunT&& hook_fun, std::size_t dtor_index = 0)
// Just throw this directly into the dtor
hook_dtor(
obj,
[hook_fun = std::forward<HookFunT>(hook_fun)](void* self)
[hook_fun_ = std::forward<HookFunT>(hook_fun)](void* self)
{
// Pass a nullop as the original, it's not okay to skip dtors
hook_fun((T*)self, [](T*) {});
hook_fun_((T*)self, [](T*) {});
},
dtor_index);
return;
Expand Down

0 comments on commit 9be67d5

Please sign in to comment.