Raised This Month: $ Target: $400
 0% 

[core] Player's cur. weap. info update meth. should be impr.


  
 
 
Thread Tools Display Modes
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 06-20-2006 , 15:19  
#11

I will leave this UP to bail. I rather think fun has a bug rather then fm.
But i wouldnt know. So i will leave this thread open and wait patiently for an answere from BAILOPAN

pm: i corrected your typo ;D
Freecode is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-20-2006 , 16:00  
#12

Personally I agree with karlos and VEN but would this not break backward compatibility somewhere? There's probably a few plugins that use this bug to their advantage.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 06-20-2006 , 16:32  
#13

hmm, i doubt any plugin would use such a bug
they rather do a work around by chaching the changeweapon message ( like i am doing )
__________________
alias White Panther
karlos is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-21-2006 , 02:13  
#14

I'm not sure which bug exactly do you mean but i'm talking only about one bug. get_user_weapon returns last weapon id if player has no weapons at all. But i doubt if that bug have been used by someone, this does not seems to be useful for me.

As for fun's strip_user_weapons i do not think there is a bug. And btw bail and faluco reviewed it not a long time ago and AFAIR they didn't counted
Code:
    *reinterpret_cast<int *>(MF_PlayerPropAddr(params[1], Player_CurrentWeapon)) = 0;
as an inappropriate action.
So why we using this "fix" only for one native while it should be fixed directly in the amxx core.
player_weaponstrip is HL engine entity which can be used by map makers so this get_user_weapon bug makes that native incompatible with standard HL engine entity.

Last edited by adm; 06-22-2006 at 15:51.
VEN is offline
BAILOPAN
Join Date: Jan 2004
Old 06-21-2006 , 02:45  
#15

There must be a reason OLO dropped out of that case, and thus I am unwilling to change that for the moment. Is there a situation where CurWeapon fires 0 when the player has a valid weapon? I don't know, but it sounds like something too general across mods and plugins to risk.

Perhaps I should add a set_user_curweapon() native?
__________________
egg
BAILOPAN is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-21-2006 , 03:30  
#16

I think i found a fix for get_user_weapon.

Code:
pev->weapons &= ~WEAPON_ALLWEAPONS
is set on player_weaponstrip entity use so on every get_user_weapon native call we can check for weapons pev field if no weapons - return 0, in other case standard behaviour.

Code:
#define WEAPON_ALLWEAPONS       (~(1<<WEAPON_SUIT)) #define WEAPON_SUIT             31
VEN is offline
BAILOPAN
Join Date: Jan 2004
Old 06-21-2006 , 03:54  
#17

this does not work because some mods do not use the weapons field (we tried it before)
__________________
egg
BAILOPAN is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-21-2006 , 08:24  
#18

Quote:
Perhaps I should add a set_user_curweapon() native?
Yes, that will solve some issues.
But that will not fix get_user_weapon issue so i think at least additional note should be added to the native's description. Those who use that native should be informed that it potentially could return incorrect result.
VEN is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 06-21-2006 , 09:16  
#19

Quote:
Originally Posted by BAILOPAN
this does not work because some mods do not use the weapons field (we tried it before)
Which mods don't obey this? I'm not going to go into detail with reasoning but when I was working on WeaponMod I found that v.weapons is very important. Without it you basically can't switch your weapons. DOD & possibly TS use a different system but its an expanded system of v.weapons to allow an additional 30 weapons.

If a mod isn't obeying this HL standard, its not your problem at the end of the day, you can only support so much.
Orangutanz is offline
BAILOPAN
Join Date: Jan 2004
Old 06-21-2006 , 11:15  
#20

It's totally up to a mod whether to use that field or not -- the SDK is mostly a sample implementation, not a requirement.

I think TS and/or ESF are examples of mods like this.

Also consider mods that have more than 31 weapons.
__________________
egg
BAILOPAN 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 17:10.


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