Raised This Month: $51 Target: $400
 12% 

enum conflict with arguments bug report


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 11-21-2020 , 05:27   enum conflict with arguments bug report
Reply With Quote #1

HOW TO BUG REPORT ?

Code:
AMX Mod X 1.10.0.5406
Authors: 
         David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko, Felix "SniperBeamer" Geyer
         Jonny "Got His Gun" Bergstrom, Lukasz "SidLuke" Wlasinski
         Christian "Basic-Master" Hammacher, Borja "faluco" Ferrer
         Scott "DS" Ehlert
Compiled: Jul 17 2020, 02:06:23
URL:http://www.amxmodx.org/
Core mode: JIT

Code:
enum _:MEHp { dmg, lasthit, victim, killerid, killername[32], Float:distance, Float:hpkiller, Float:apkiller };

public client_death(killer, victim, wpnindex, hitplace, TK)
{
	log_message("client_death: %i / %i", killer, victim)

}
In log file, victim always == 2

client_death: 1 / 2

client_death: 5 / 2


In compiler no warning!

Last edited by karaulov; 11-21-2020 at 05:57.
karaulov is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-21-2020 , 07:39   Re: enum conflict with arguments bug report
Reply With Quote #2

cleared
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-21-2020 , 11:24   Re: enum conflict with arguments bug report
Reply With Quote #3

Go to github and open an issue, but I doubt it will get fixed (soon). In the meantime, a good way to avoid this is to prefix your enums with a designated letter or prefix: eDmg, eLastHit.
__________________

Last edited by HamletEagle; 11-21-2020 at 11:25.
HamletEagle is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 11-21-2020 , 12:08   Re: enum conflict with arguments bug report
Reply With Quote #4

But it compiler error))
Need write warning in this cause..
Where located compiler at github?))
karaulov is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-21-2020 , 19:19   Re: enum conflict with arguments bug report
Reply With Quote #5

how are you hooking the event...?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-21-2020 , 21:24   Re: enum conflict with arguments bug report
Reply With Quote #6

Quote:
Originally Posted by Napoleon_be View Post
how are you hooking the event...?
It's not specific to that event so it doesn't really matter. There should be some kind of warning that you are attempting to use globally declared constants for a function. As HamletEagle mentioned, if you name your constants intelligently, you can avoid the issue entirely.
PHP Code:

#include <amxmodx>

enum Whatever
{
    
killer,
    
victim
}

public 
plugin_init() 
{
    
Test88 99 );
}

public 
Testkiller victim )
{
    
server_print"%d %d" killer victim )

Output
Code:
0 1
__________________

Last edited by Bugsy; 11-21-2020 at 21:25.
Bugsy is offline
Reply



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 07:32.


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