Closed rt-2 closed 7 years ago
Remove your IsPlayerSpawned - weapon-config will make its own.
I am talking about the 'IsPlayerSpawned' inside weapon-config that I need to modify. I don't think I ever use this function myself, I use 'IsPlayerValid' or I have a variable 'PlayerSpawned' that goes from -3 to 1. So I don't use this function name myself.
Then it is most definitely a compiler bug - do you have those error messages in your log? I need to see where it is triggered.
It's triggered from OnPlayerGiveDamage
in
if (!IsPlayerSpawned(playerid)) {
// Make sure the rejected hit wasn't added in OnPlayerWeaponShot
if (!IsBulletWeapon(weaponid) || s_LastShot[playerid][e_Valid]) {
AddRejectedHit(playerid, damagedid, HIT_NOT_SPAWNED, weaponid);
}
return 0;
}
AddRejectedHit
is not called and the error is returned if IsPlayerSpawned
is a stock
I think another include or perhaps your gamemode declares a IsPlayerSpawned. It could be that it is declared as static, which should not cause problems but I have encountered problems with the Pawn compiler before where a static function sharing the name of a global function caused strange behavior.
Could you search through your project for IsPlayerSpawned?
It's a native in YSF.
I didn't mean to 'close' this issue, I pressed the wrong button
The one in YSF will not be correct and should not be used. I'd suggest doing something like this:
#define IsPlayerSpawned IsPlayerSpawned_YSF
#include <YSF>
#undef IsPlayerSpawned
#include <weapon-config>
So the one in weapon-config willl be compatible with YSF AND weapon-config? I just don't wanna break my YSF either.
Thank you,
Yes it will be. The one in YSF is very simple - it just checks the player state and whether spawn info has been given. weapon-config does that also.
https://github.com/kurta999/YSF/blob/94baaf7b946ddf0a34820b2d4ac734774ecb116f/src/Natives.cpp#L2141
I got "runtime error 11: devided by zero" in OnPlayerWeaponShot, unless I change the IsPlayerSpawned stock function into a forwarded public function.
Now everything works fine,, weird. Thought I'd let you guys know...
Thank you, rt-2