Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

qtscript: Add new event 'eventObjectRecycled(object)' for demolish an…

…d recycle actions.
  • Loading branch information...
commit a98cf2ace771bdde9556eadd6243691264d50864 1 parent f647455
@perim perim authored
View
1  src/droid.cpp
@@ -452,6 +452,7 @@ void recycleDroid(DROID *psDroid)
position.z = psDroid->pos.y;
position.y = psDroid->pos.z;
+ triggerEvent(TRIGGER_OBJECT_RECYCLED, psDroid);
vanishDroid(psDroid);
addEffect(&position, EFFECT_EXPLOSION, EXPLOSION_TYPE_DISCOVERY, false, NULL, false, gameTime - deltaGameTime + 1);
View
3  src/qtscript.cpp
@@ -892,6 +892,9 @@ bool triggerEvent(SCRIPT_TRIGGER_TYPE trigger, BASE_OBJECT *psObj)
callFunction(engine, "eventReinforcementsArrived", QScriptValueList()); // deprecated!
callFunction(engine, "eventTransporterArrived", args);
break;
+ case TRIGGER_OBJECT_RECYCLED:
+ callFunction(engine, "eventObjectRecycled", args);
+ break;
case TRIGGER_TRANSPORTER_EXIT:
callFunction(engine, "eventTransporterExit", args);
break;
View
3  src/qtscript.h
@@ -42,7 +42,8 @@ enum SCRIPT_TRIGGER_TYPE
TRIGGER_MISSION_TIMEOUT,
TRIGGER_GAME_LOADED,
TRIGGER_GAME_SAVING,
- TRIGGER_GAME_SAVED
+ TRIGGER_GAME_SAVED,
+ TRIGGER_OBJECT_RECYCLED
};
// ----------------------------------------------
View
1  src/structure.cpp
@@ -928,6 +928,7 @@ void structureBuild(STRUCTURE *psStruct, DROID *psDroid, int buildPoints, int bu
}
if (buildPoints < 0 && psStruct->currentBuildPts == 0)
{
+ triggerEvent(TRIGGER_OBJECT_RECYCLED, psStruct);
removeStruct(psStruct, true);
}
Please sign in to comment.
Something went wrong with that request. Please try again.