Fixed Magneto Stick setting nil Owner on active SWEP #947

Merged
merged 3 commits into from May 24, 2015

Projects

None yet

3 participants

@MisterDot
Contributor

Prevents the Magneto Stick from resetting a SWEP's Owner after being dropped.

It is possible to equip a weapon while holding it with the stick. Previously this prevented the weapon from being used properly and caused script errors. The player would need to equip the weapon again after dropping it to solve the issue.

@MisterDot MisterDot Fix Magneto Stick setting nil Owner on active SWEP
Prevents the Magneto Stick from resetting a SWEP's Owner after the player has picked the weapon up which makes the weapon unusable until dropped again.
ba7e348
@robotboy655 robotboy655 added the TTT label May 14, 2015
@svdm
Collaborator
svdm commented May 15, 2015

Looks good, but I suspect the change should also be made in the Pickup() logic, so that we don't set the carrying player as the weapon's owner and then never reset that when they drop it.

It should suffice to do the same IsWeapon check here:
https://github.com/MisterDot/garrysmod/blob/patch-1/garrysmod/gamemodes/terrortown/entities/weapons/weapon_zm_carry.lua#L375

@MisterDot MisterDot Added IsWeapon check to Pickup, comments
PrevOwner and ent.Owner are no longer set when picking up a weapon.

Added comments also.
e7978f2
@MisterDot
Contributor

Updated.

@MisterDot MisterDot Props are now picked up using the correct angle
The weld constraint was being added before CarryHack had its angle set properly. No longer.

It feels much easier now to move props around however you please. Ragdolls seem noticeably less buggy as well.
3f8b899
@MisterDot
Contributor

Added something else. Hope that's alright.

@svdm svdm merged commit 270276b into garrynewman:master May 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment