WebDev

Battle => Battle Support => Topic started by: swordie on July 10, 2014, 10:30:25 PM

Title: Member slay reset
Post by: swordie on July 10, 2014, 10:30:25 PM
I have a problem that whenever a player attacks you and dies it resets your member slays (this goes for any user). If you attack another player and win the member slays will rise but they will reset again as soon as someone attacks you and dies. I am currently using battle v 1.14. I have tried it on multiple servers and they all have the same issue.

I think I have isolated the problem to something involving this in BattleOpps.php:

$target_slays = !empty($user_profile[$row['id_slain']]['mem_slays']) ?  $user_profile[$row['id_slain']]['mem_slays'] : 0;

I believe it thinks the $user_profile[$row['id_slain']]['mem_slays'] is empty so it's setting target_slays as 0. It then goes through the update code and adds the +1 so the total member slays of the user ends up being 1. After testing many scenarios this seemed to be the most likely thing that was happening. I've tried to fix it myself but I'm completely stuck. I was wondering if anyone had a solution to this problem. Thank you in advance.
Title: Re: Member slay reset
Post by: SA on July 11, 2014, 05:16:32 AM
i think this should be

$user_profile[$context['battle_target']['id_member']]['mem_slays']

instead of
$user_profile[$row['id_slain']]['mem_slays']

could be wrong there worth a try i guess
Title: Re: Member slay reset
Post by: swordie on July 11, 2014, 10:49:29 AM
It worked! I assumed it was a syntax error but I couldn't find the correct syntax. Thanks for your help   :D
Title: Re: Member slay reset
Post by: SA on July 12, 2014, 02:27:06 PM
wow not a bad guess huh :P
EhPortal 1.39.6 © 2024, WebDev