Domination icon indicating copy to clipboard operation
Domination copied to clipboard

cannot pick up weapons lying around when playing unranked

Open longtimegamer opened this issue 4 years ago • 13 comments

I can't pick up weapons from dead AI since the weapons disappear. No mods and server is unranked.

longtimegamer avatar Oct 17 '21 03:10 longtimegamer

I also tried with server set to d_arsenal_mod=1.

longtimegamer avatar Oct 17 '21 03:10 longtimegamer

Vanilla? And which weapons?

Xeno69 avatar Oct 17 '21 09:10 Xeno69

I have just tried on a dedicated server, no problems at all.

I need a weapon class name.

Xeno69 avatar Oct 17 '21 09:10 Xeno69

Ok maybe I am crazy...

I will reopen this issue if I see it again.

longtimegamer avatar Nov 07 '21 20:11 longtimegamer

@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

longtimegamer avatar Mar 31 '23 17:03 longtimegamer

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

longtimegamer avatar Dec 29 '23 02:12 longtimegamer

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

longtimegamer avatar Jan 13 '24 13:01 longtimegamer

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}];
};

longtimegamer avatar Jan 13 '24 13:01 longtimegamer

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

longtimegamer avatar Jan 13 '24 13:01 longtimegamer

Ok, this does not fix the actual bug but it will prevent ptakeweapon from running when the bug occurs. Maybe that is sufficient.

longtimegamer avatar Jan 13 '24 14:01 longtimegamer

this fix is part of https://github.com/Xeno69/Domination/pull/607

EDIT: The workaround was reverted. This issue is still a problem.

longtimegamer avatar Jan 13 '24 16:01 longtimegamer

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.

longtimegamer avatar Mar 17 '24 14:03 longtimegamer

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.

longtimegamer avatar Mar 17 '24 14:03 longtimegamer

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.

longtimegamer avatar Apr 28 '24 15:04 longtimegamer

@Xeno69 it would be nice to fix this before the next release

longtimegamer avatar Apr 28 '24 15:04 longtimegamer

is this ok? this adds another parameter but it works.

https://github.com/Xeno69/Domination/pull/636

longtimegamer avatar Apr 28 '24 22:04 longtimegamer