 |
|
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
|

06-19-2020
, 22:13
Re: Menu showing twice?
|
#2
|
Have you done any debugging? What is the value of iClass (Line 337)? Based on what you've described (I think), it's returning a value of 0 every time.
The other thing that I notice is that in your menu handler, you call the rank_tw_c_xxx() function before you set g_Class[id] so when you use g_Class[id] in the rank_tw_c_xxx() function, it will have the old value in it.
Also, lines 388 and 425 ("if( iClass )") will always return false.
It looks like you have several places where you are duplicating code. For example, you set the health, maxspeed, and gravity in the same manner in both the spawn function and the menu handler. You should optimize the duplicate code into its own function.
Overall, I think you might consider rethinking the logic you're using here. I think you're making it more complicated than it needs to be. If I think of a simple example, I'll post it.
__________________
Last edited by fysiks; 06-19-2020 at 22:20.
|
|
|
|