Raised This Month: $ Target: $400
 0% 

Solved Menu showing twice?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2020 , 22:13   Re: Menu showing twice?
Reply With Quote #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.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode