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:
@@ -46,8 +46,10 @@ namespace Noggit
|
|||||||
}
|
}
|
||||||
else if(!unsafe_uid_is_used(uid))
|
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)
|
if (NOGGIT_CUR_ACTION)
|
||||||
NOGGIT_CUR_ACTION->registerObjectAdded(&instance);
|
NOGGIT_CUR_ACTION->registerObjectAdded(&instance);
|
||||||
|
*/
|
||||||
_m2s.emplace(uid, instance);
|
_m2s.emplace(uid, instance);
|
||||||
_instance_count_per_uid[uid] = 1;
|
_instance_count_per_uid[uid] = 1;
|
||||||
return uid;
|
return uid;
|
||||||
@@ -95,8 +97,10 @@ namespace Noggit
|
|||||||
}
|
}
|
||||||
else if (!unsafe_uid_is_used(uid))
|
else if (!unsafe_uid_is_used(uid))
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (NOGGIT_CUR_ACTION)
|
if (NOGGIT_CUR_ACTION)
|
||||||
NOGGIT_CUR_ACTION->registerObjectAdded(&instance);
|
NOGGIT_CUR_ACTION->registerObjectAdded(&instance);
|
||||||
|
*/
|
||||||
_wmos.emplace(uid, instance);
|
_wmos.emplace(uid, instance);
|
||||||
_instance_count_per_uid[uid] = 1;
|
_instance_count_per_uid[uid] = 1;
|
||||||
return uid;
|
return uid;
|
||||||
|
|||||||
Reference in New Issue
Block a user