Cleaning up redundant mission variables
Posted: Thu Jul 21, 2011 7:03 pm
I'm embarrassed to ask this because it's such a simple question, but how do I delete mission variables set by an equipment OXP, when the equipment is removed? I.e. this will look familiar:
While EQ_WHATEVER was in use it stored a parameter in a missionVariable_whatever_param. What do I need to add to the code above to clean that up?
Code: Select all
this.playerBoughtEquipment = function(equipmentKey)
{
if(equipmentKey == "EQ_WHATEVER_REMOVAL")
{
player.ship.removeEquipment("EQ_WHATEVER");
player.ship.removeEquipment("EQ_WHATEVER_REMOVAL");
player.credits += (EquipmentInfo.infoForKey("EQ_WHATEVER").price * 0.1 * 0.6);
}
}