Skip to content

Several fixes for the CloneMapEvent/DestroyMapEvent commands - #3411

Merged
Ghabry merged 5 commits into
EasyRPG:masterfrom
florianessl:fix/CloneDestroyEventFixes
Jun 1, 2025
Merged

Several fixes for the CloneMapEvent/DestroyMapEvent commands#3411
Ghabry merged 5 commits into
EasyRPG:masterfrom
florianessl:fix/CloneDestroyEventFixes

Conversation

@florianessl

Copy link
Copy Markdown
Member

Fixes following issues with these EasyRPG-commands:

  • Cloned & destroyed events were not considered by the map setup code which is responsible for loading savegame data. This was especially dangerous if a pre-existing map event has been destroyed because the code assumed both the original & the savegame data vectors of events to be both the same size & in the same order, with no skipping of IDs.
  • Added check before refresh of "scene": If the CloneMapEvent function was called from inside the map setup code, the map scene might not be created yet.
  • Fix EasyRPG-exclusive command "DestroyMapEvent": "ThisEvent" not supported #3393
  • Sometimes CloneMapEvent would write garbage data into the field "easyrpg_clone_event_id" due to an invalid pointer (Vector reallocation issue)

Test project:

CloneDestroyMapEventTest.zip

@Ghabry Ghabry added this to the 0.8.2 milestone May 7, 2025
Comment thread src/game_map.cpp
if (is_cloned_evt && CloneMapEvent(
save_ev.easyrpg_clone_map_id, save_ev.easyrpg_clone_event_id,
save_ev.position_x, save_ev.position_y,
save_ev.ID, "")) { // FIXME: Customized event names for saved events aren't part of liblcf/SaveMapEvent at the moment & thus cannot be restored

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw you can add a new chunk for this. Just won't be fixed as part of the patch release as we don't bump liblcf.

@Ghabry Ghabry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Clone Event" upon load will likely fail in the web player because of async fetch requirements when the map is different but I don't see a simple solution for this right now :/

@Ghabry Ghabry added Event/Interpreter EasyRPG New functionality exclusive to EasyRPG Player labels May 18, 2025
@Ghabry Ghabry mentioned this pull request May 31, 2025
@Ghabry

Ghabry commented Jun 1, 2025

Copy link
Copy Markdown
Member

Because this is loading code I don't want that it crashes for the user so I added another range check and removed the assert.

@florianessl could you quickly test this again with some games (and with your Clone Destroy Event stuff xD)

@florianessl

Copy link
Copy Markdown
Member Author

screenshot_1

Well, it looks like it works fine with Urban Purrrge. And that game spawns 1000s of mobs & blood stains :D
I had the event counter overflow several times to test this out. (enemies will spawn indefinitely & just override previous ones when the upper ID limit is reached)

https://rmarchiv.de/games/3694

@Ghabry

Ghabry commented Jun 1, 2025

Copy link
Copy Markdown
Member

Okay I think this received enough testing. Gonna merge it.

@Ghabry
Ghabry merged commit 29a8515 into EasyRPG:master Jun 1, 2025
sevenc-nanashi pushed a commit to sevenc-nanashi/easyrpg-player that referenced this pull request May 31, 2026
…tFixes

Several fixes for the CloneMapEvent/DestroyMapEvent commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EasyRPG New functionality exclusive to EasyRPG Player Event/Interpreter

Development

Successfully merging this pull request may close these issues.

EasyRPG-exclusive command "DestroyMapEvent": "ThisEvent" not supported

2 participants