Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression: Overzealous emitter dupe fix #1173

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion desktop_version/src/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,18 @@ static bool gridmatch( int p1, int p2, int p3, int p4, int p11, int p21, int p31

static void entityclonefix(entclass* entity)
{
if (entity->behave == 10 || entity->behave == 12)
const bool is_lies_emitter = entity->behave == 10;
const bool is_factory_emitter = entity->behave == 12;

const bool in_lies_emitter_room =
game.roomx >= 113 && game.roomx <= 117 && game.roomy == 111;
const bool in_factory_emitter_room =
game.roomx == 113 && game.roomy >= 108 && game.roomy <= 110;

const bool valid = (is_lies_emitter && in_lies_emitter_room)
|| (is_factory_emitter && in_factory_emitter_room);

if (!valid)
{
/* Fix memory leak */
entity->behave = -1;
Expand Down
Loading