Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » ArmedObjects having NULL weapons in their weapon list
Re: ArmedObjects having NULL weapons in their weapon list [message #490211 is a reply to message #490207] Wed, 31 December 2014 09:46 Go to previous messageGo to previous message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma:
Recruit
Jerad Gray wrote on Wed, 31 December 2014 08:28

danpaul88 wrote on Wed, 31 December 2014 08:06

As I recall index zero of the weapon bag is always a null "no weapon" weapon... jonwil could confirm that though.

Which would make sense, far easier to have a slot for no weapon then hacking in a special "no weapon" state into all the weapon functions.


Well how I would do it is to have the WeaponIndex variable be -1. That saves 4 bytes of memory so you don't have to store the NULL pointer in the weapon list Very Happy
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: scripts 4.2 RC1 is now available for testing
Next Topic: Scripts 4.2 to enter private beta testing soon, here are some changes in it
Goto Forum:
  


Current Time: Fri Nov 01 03:54:27 MST 2024

Total time taken to generate the page: 0.00948 seconds