cannot pick up weapons lying around when playing unranked
I can't pick up weapons from dead AI since the weapons disappear. No mods and server is unranked.
I also tried with server set to d_arsenal_mod=1.
Vanilla? And which weapons?
I have just tried on a dedicated server, no problems at all.
I need a weapon class name.
Ok maybe I am crazy...
I will reopen this issue if I see it again.
@Xeno69 remember this old bug? I think your recent commit fixed it!
https://github.com/Xeno69/Domination/commit/22bbeb372342e33cfcf84027a2b264b9aa460a9e
EDIT: wrong commit EDIT2: still broken
Something is weird here...
The server is using only default parameters. If I pick up a .50 cal sniper rifle from a dead Opfor sniper then the rifle disappears. Is this expected behavior if the player is low rank?
If the server is using CUP then all weapons disappear even when unranked.
The only way I can stop this behavior is to remove call d_fnc_ptakeweapon in fn_setupplayer.sqf:
https://github.com/Xeno69/Domination/blob/master/co30_Domination.Altis/client/fn_setupplayer.sqf#L302
I have just tried on a dedicated server, no problems at all.
I need a weapon class name.
When I try on a dedicated server, the new weapon in my hand disappears and my old primary weapon re-appears. This happens for any weapon including non-DLC and non-mod weapons (example: the Katiba).
parameters:
d_with_ranked = 1; // no d_save_to_mpns = 0; // no d_arsenal_mod = 1; // no
If d_fnc_ptakeweapon is only for NVGs then maybe we can skip that function? I don't know why ptakeweapon is forcing this weapon problem but I don't think the function needs to run on a server that disables rank and does not force remove NVGs.
BEFORE
// available in non ranked versions too, removes nvg if without nvg is activated to avoid cheating
player addEventhandler ["Take", {call d_fnc_ptakeweapon}];
AFTER
// available in non ranked versions too, removes nvg if without nvg is activated to avoid cheating
if (!d_with_ranked && { d_without_nvg != 1 }) then {
player addEventhandler ["Take", {call d_fnc_ptakeweapon}];
};
I added the expression in this commit:
95ff4813502fb57bc970b458510d283c55d0f0d1
let me know if you want a different solution
EDIT: that commit doesn't work, I will fix it
EDIT 2: fixed 5da10d27e4c5bba2596a9d85bd218c7013956726
Ok, this does not fix the actual bug but it will prevent ptakeweapon from running when the bug occurs. Maybe that is sufficient.
this fix is part of https://github.com/Xeno69/Domination/pull/607
EDIT: The workaround was reverted. This issue is still a problem.
I have just tried on a dedicated server, no problems at all.
I need a weapon class name.
Can you explain what you did to test this? I have tested with rank "off" and I can reproduce the problem easily.
When unranked, why do you need to remove weapons in pcheck?
https://github.com/Xeno69/Domination/blob/master/co30_Domination.Altis/client/fn_ptakeweapon.sqf#L16-L19
Why are you messing with the Arma inventory system?
You said this in another comment:
ptakeweapon does checks even if ranked is disabled (if weapons are missing then parts of the classes have to be added like it is done for other mods)
I do not understand what that means.
I would suggest a way to remove that entire pcheck logic and stop messing with the basic Arma inventory system.
I forked this a while ago until I can understand what you are trying to do. From a player perspective, it is simply broken for many years.
make this...
player addEventhandler ["Take", {call d_fnc_ptakeweapon}];
...into this...
if (!d_with_ranked && { d_without_nvg != 1 }) then {
player addEventhandler ["Take", {call d_fnc_ptakeweapon}];
};
Why not?
Is it better to add another server parameter? d_please_please_please_disable_ptakeweapon is a good name.
@Xeno69 it would be nice to fix this before the next release
is this ok? this adds another parameter but it works.
https://github.com/Xeno69/Domination/pull/636