Probable error [message #478091] |
Wed, 19 December 2012 15:20 |
Agent
Messages: 46 Registered: November 2010 Location: United States
Karma: 0
|
Recruit |
|
|
In SSGMGameManager::PowerupPurchaseHook, SSGMGameManager::VehiclePurchaseHook, and SSGMGameManager::CharacterPurchaseHook methods of gmgame.cpp, there appears to be a slight logic error. Each of them contain something along the lines of:
int ret = RegisteredEvents[EVENT_CHARACTER_PURCHASE_HOOK][i]->OnCharacterPurchase(base,purchaser,cost,preset,data);
if (ret != -1)
{
return ret;
}
if (ret == -2)
{
fp = true;
}
The second if statement will never be reached in the even which it is true, as when ret == -2, it will have already return.
I'm assuming the intended behavior would have:
int ret = RegisteredEvents[EVENT_CHARACTER_PURCHASE_HOOK][i]->OnCharacterPurchase(base,purchaser,cost,preset,data);
if (ret == -2)
{
fp = true;
}
else if (ret != -1)
{
return ret;
}
Edits:
Also, will there be a method implemented into the Plugin class to allow for plugins to detect player/vehicle/building/object deaths? I'm trying to avoid modifying scripts.dll directly for my IRC bot.
[Updated on: Wed, 19 December 2012 15:32] Report message to a moderator
|
|
|
|
|
|