The devs are over at sc2mapster, so I figure I'll try my luck out here. I'm in no way affiliated with the map, nor do I have an unprotected copy of the map to really test, but perhaps someone can shed some light on possible errors. The game here is Night of the Dead, and in case you haven't played it, it's pretty much up there with RUSH in terms of epicness.
What is supposed to happen:
Custom button "Drop Magazine" is supposed to take 3 magazines from your equipped slot and create 1 magazine pack in your inventory. If you have a magazine pack in your inventory with a stack less than 3, it will increase the stack by 1.
What used to happen:
If you have a magazine pack in your inventory, dropping another set will increase the magazine pack to 4.
What currently happens:
If you have a magazine pack in your inventory, dropping another set will create 2 magazine packs and a
negative magazine pack. If you fill up your inventory, the negative pack will be dropped on the ground, netting 1 extra magazine. If you have two magazine packs in separate stacks, the negative pack will count as positive, netting 2 extra magazines.
trigger

//--------------------------------------------------------------------------------------------------
// Trigger: Drop Magazine
//--------------------------------------------------------------------------------------------------
bool gt_DropMagazine_Func (bool testConds, bool runActions) {
// Variable Declarations
unit lv_triggUnit;
int lv_localIntA;
unit lv_dummyCarrier;
unit lv_magazine;
// Variable Initialization
lv_triggUnit = EventUnit();
lv_localIntA = UnitGetOwner(EventUnit());
lv_dummyCarrier = null;
lv_magazine = null;
// Conditions
if (testConds) {
if (!((gv_marineMags[lv_localIntA] >= 3))) {
return false;
}
}
// Actions
if (!runActions) {
return true;
}
UnitInventoryCreate(lv_triggUnit, "Magazine");
lv_magazine = UnitInventoryLastCreated();
libNtve_gf_UnitSetVariation(lv_magazine, "Crate", 1, "");
if ((UnitIsValid(lv_magazine) == true)) {
UnitAddChargeUsed(lv_magazine, "Ammo/Magazine", 2.0);
}
else {
libNtve_gf_CreateUnitsWithDefaultFacing(1, "Rifleman", 0, 0, UnitGetPosition(lv_triggUnit));
lv_dummyCarrier = UnitLastCreated();
libNtve_gf_ShowHideUnit(lv_dummyCarrier, false);
UnitInventoryCreate(lv_dummyCarrier, "Magazine");
lv_magazine = UnitInventoryLastCreated();
UnitSetOwner(lv_magazine, 0, true);
Wait(0.1, c_timeGame);
libNtve_gf_UnitSetVariation(lv_magazine, "Crate", 1, "");
UnitAddChargeUsed(lv_magazine, "Ammo/Magazine", 2.0);
Wait(0.1, c_timeGame);
UnitKill(lv_dummyCarrier);
}
gv_marineMags[lv_localIntA] -= 3;
libNtve_gf_SetDialogItemText(gv_ammoCounterDialogItem[lv_localIntA][1], IntToText(gv_marineRounds[lv_localIntA]), PlayerGroupActive());
libNtve_gf_SetDialogItemText(gv_ammoCounterDialogItem[lv_localIntA][2], IntToText(gv_marineMags[lv_localIntA]), PlayerGroupActive());
gf_UpdateInventoryDialog(lv_localIntA);
gf_EquipmentUpdateMarineWeight(lv_localIntA);
return true;
}
//--------------------------------------------------------------------------------------------------
void gt_DropMagazine_Init () {
gt_DropMagazine = TriggerCreate("gt_DropMagazine_Func");
TriggerAddEventUnitAbility(gt_DropMagazine, null, AbilityCommand("DropMagazine", 0), c_unitAbilStageComplete, false);
}
For ethical reasons I'm not going to post all the triggers, but perhaps an sc2 mapper will see something or can open up the full triggers and see if they can make anything of it.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"