Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Probable error
Probable error [message #478091] Wed, 19 December 2012 15:20 Go to previous message
Agent is currently offline  Agent
Messages: 46
Registered: November 2010
Location: United States
Karma:
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

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Just some idea for next update
Next Topic: graphic updates
Goto Forum:
  


Current Time: Fri Nov 08 15:36:32 MST 2024

Total time taken to generate the page: 0.00685 seconds