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 #490216 is a reply to message #490211] Thu, 01 January 2015 08:29 Go to previous messageGo to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3808
Registered: July 2006
Location: USA
Karma:
General (3 Stars)
Neijwiert wrote on Wed, 31 December 2014 09:46

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

However, if they stored them in an array instead of a linked list -1 could cause some pretty serious issues Razz


 
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: Sun Sep 29 22:43:44 MST 2024

Total time taken to generate the page: 0.00935 seconds