Daily Lucky Numbers:
5
9
12
29
34
38

Member slay reset

Started by swordie, July 10, 2014, 10:30:25 PM

Previous topic - Next topic

swordie

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.

SA

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
http://samods.github.io/SAChatBar/

Customizer @ SimpleMachines

swordie

It worked! I assumed it was a syntax error but I couldn't find the correct syntax. Thanks for your help   :D

SA

http://samods.github.io/SAChatBar/

Customizer @ SimpleMachines