fix bug where loading a tile while doing an actino adds the tiles objects to the action stack, and cause a crash when undoing that action

This commit is contained in:
T1ti
2024-07-18 19:26:08 +02:00
parent b4c411311e
commit 04b993b6d5

View File

@@ -46,8 +46,10 @@ namespace Noggit
}
else if(!unsafe_uid_is_used(uid))
{
/* This causes a crash when undoing while loading a tile, those objects get registered to the action stack
if (NOGGIT_CUR_ACTION)
NOGGIT_CUR_ACTION->registerObjectAdded(&instance);
*/
_m2s.emplace(uid, instance);
_instance_count_per_uid[uid] = 1;
return uid;
@@ -95,8 +97,10 @@ namespace Noggit
}
else if (!unsafe_uid_is_used(uid))
{
/*
if (NOGGIT_CUR_ACTION)
NOGGIT_CUR_ACTION->registerObjectAdded(&instance);
*/
_wmos.emplace(uid, instance);
_instance_count_per_uid[uid] = 1;
return uid;