MantisBT - Zandronum
View Issue Details
0002187Zandronum[All Projects] Bugpublic2015-04-14 00:072018-09-30 21:37
nax 
Edward-san 
normalminoralways
closedfixed 
MicrosoftWindowsXP/Vista/7
2.0 
2.12.1 
0002187: A_CustomPunch lifesteal does not update clients' HP visual on Multiplayer
In Single Player, setting a lifesteal value when using A_CustomPunch will gain HP from every hit as intended. In Multiplayer, it still works, but it simply doesn't visually update a clients' HP when connected to a server.

ie:
Singleplayer - HP: 50. after attacking enemy, hp reads 55.
Multiplayer - HP: 50. after enemy attack, hp reads 50 - enemy deals 1 damage to you, your HP is now 54.
create a fist weapon using A_CustomPunch with a lifesteal value of whatever. my addon uses

A_CustomPunch(random(15,20)*5,1,0,"FistPuff",0,0.09)

for the damage / lifesteal component.

---

Go into Singleplayer, ensure your HP is below 100, and attack an enemy. Do so in Multiplayer, and notice no drop in HP.
No tags attached.
related to 0002335closed Edward-san A_Saw lifesteal attack desync online 
txt decorate.txt (216) 2015-04-14 12:32
/tracker/file_download.php?file_id=1461&type=bug
Issue History
2015-04-14 00:07naxNew Issue
2015-04-14 08:19Edward-sanAssigned To => Edward-san
2015-04-14 08:19Edward-sanStatusnew => assigned
2015-04-14 08:31Edward-sanNote Added: 0012105
2015-04-14 08:31Edward-sanStatusassigned => feedback
2015-04-14 12:32Edward-sanFile Added: decorate.txt
2015-04-14 12:36Edward-sanNote Added: 0012106
2015-04-14 12:36Edward-sanStatusfeedback => needs review
2015-04-15 00:36naxNote Added: 0012111
2015-04-18 13:38Torr SamahoNote Added: 0012134
2015-04-18 13:38Torr SamahoStatusneeds review => feedback
2015-04-18 17:21cobaltStatusfeedback => needs testing
2015-04-18 17:21cobaltTarget Version => 2.1
2015-04-18 17:21cobaltDescription Updatedbug_revision_view_page.php?rev_id=6982#r6982
2015-04-18 17:21cobaltSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6984#r6984
2015-04-18 17:21cobaltNote Added: 0012137
2015-04-24 00:57HypnotoadNote Added: 0012162
2015-04-24 03:59DuskStatusneeds testing => resolved
2015-04-24 03:59DuskFixed in Version => 2.1
2015-04-24 03:59DuskResolutionopen => fixed
2015-07-07 18:11Edward-sanRelationship addedrelated to 0002335
2018-09-30 21:37Blzut3Statusresolved => closed

Notes
(0012105)
Edward-san   
2015-04-14 08:31   
Can you provide an example wad for this issue?
(0012106)
Edward-san   
2015-04-14 12:36   
I managed to reproduce the issue with the attached example decorate file, with sv_cheats 1 and 'give fist2'.

I fixed this with'https://bitbucket.org/crimsondusk/zandronum-sandbox/commits/958595a0273f62fd9d61e8adaa102f9486f17997 [^]' .
(0012111)
nax   
2015-04-15 00:36   
Sorry, haven't been feeling too good lately. Just for clarity's sake, I tested again with edward's own example (thanks) and is easily reproduced.

"Go into Singleplayer, ensure your HP is below 100, and attack an enemy. Do so in Multiplayer, and notice no drop in HP."

I mean that last bit to say "no gain in HP." Whoops!
(0012134)
Torr Samaho   
2015-04-18 13:38   
Overall, the patch looks pretty good. I left two comments on bitbucket.
(0012137)
cobalt   
2015-04-18 17:21   
Issue addressed by commit bbae072: - Fixed possible health desync issues in some situations (addresses 2187). Specifically: 1) add the server handling inside the function P_GiveBody; 2) simplify the server handling outside the function P_GiveBody; 3) add missing server handling in places where health was changed. 4) add #error for when zdoom r3438, which simplifies AHealth::TryPickup by using P_GiveBody, will be backported
Committed by edward_san [edward-san] on Saturday 18 April 2015 17:59:14

Changes in files:
 docs/zandronum-history.txt | 1 +
 src/g_hexen/a_healingradius.cpp | 4 ----
 src/g_shared/a_pickups.cpp | 22 ++++++++++++++++++++++
 src/p_interaction.cpp | 6 +-----
 src/p_map.cpp | 4 ----
 src/p_user.cpp | 6 +-----
 6 files changed, 25 insertions(+), 18 deletions(-)
(0012162)
Hypnotoad   
2015-04-24 00:57   
Tested using Edward-san's code: confirmed to work fine on local server.