Fully implemented delete, added an easy-to-use ID lookup system for undo commands, fixed a bunch of crashes when undoing/redoing after creating/deleting an object

This commit is contained in:
parax0
2016-03-16 19:09:59 -06:00
parent 63812ae4b2
commit c4e05610f3
66 changed files with 992 additions and 569 deletions

View File

@@ -20,7 +20,7 @@ protected:
public:
explicit CScriptExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0)
: CSceneNode(pScene, pParent),
: CSceneNode(pScene, -1, pParent),
mpInstance(pInstance),
mGame(pInstance->Template()->Game())
{

View File

@@ -53,7 +53,7 @@ void CSplinePathExtra::AddWaypoints()
if ( (pLink->State() == 0x49533030 && pLink->Message() == 0x41544348) || // InternalState00/Attach
(pLink->State() == 0x4D4F5450 && pLink->Message() == 0x41544348) ) // MotionPath/Attach
{
CScriptNode *pNode = mpScene->ScriptNodeByID(pLink->ReceiverID());
CScriptNode *pNode = mpScene->NodeForInstanceID(pLink->ReceiverID());
if (pNode && pNode->Object()->ObjectTypeID() == 0x57415950) // Waypoint
{

View File

@@ -85,7 +85,7 @@ void CWaypointExtra::BuildLinks()
if (IsPathLink(pLink))
{
CScriptNode *pNode = mpScene->ScriptNodeByID(pLink->ReceiverID());
CScriptNode *pNode = mpScene->NodeForInstanceID(pLink->ReceiverID());
SWaypointLink Link;
Link.pWaypoint = pNode;
@@ -117,7 +117,7 @@ bool CWaypointExtra::IsPathLink(CLink *pLink)
if (Valid)
{
CScriptNode *pNode = mpScene->ScriptNodeByID(pLink->ReceiverID());
CScriptNode *pNode = mpScene->NodeForInstanceID(pLink->ReceiverID());
if (pNode)
return pNode->Object()->ObjectTypeID() == mpInstance->ObjectTypeID();