se7enet purgatorio

Page 1 of 1 1
Topic Options
Rate This Topic
#15740 - 09/26/07 02:17 PM Bad Bug For Run Event + Fix!!
Brendon
Grape Nuts


Registered: 09/18/07
Posts: 40

Offline
There is a bad bug in DK when you are in a fight with a monster much more powerful then you are. when you try to run it sends you to Midworld (0 lat, 0 long) but yet says you are still exploring. also it does it automatically. as if you ran away but appeared in an invalid location..
Here is the code in Fight.php
This coding may need to be edited to suit your game. I will not modify this code anymore.
to find this code with ease search for if (isset($_POST["run"])) { and its at the bottom..

Original..
 PHP:
if ($userrow["currenthp"] <= 0) { $newgold = ceil($userrow["gold"]/0); $newhp = ceil($userrow["maxhp"]/4); $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); $playerisdead = 1; } } } $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); header("Location: index.php"); die();





Fixed..
 PHP:
if ($userrow["currenthp"] <= 0) { $newgold = ceil($userrow["gold"]/2); $newhp = ceil($userrow["maxhp"]/4); $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); $playerisdead = 1; $page = "<div align=\"center\"><img src=\"images/races/{{gender}}/{{charrace}}_dead.jpg\" border=\"0\" /></div><BR>You turn to run away and the beast lays one last blow on you!<br /><b>You have been Killed.</b><br /><br />As a consequence, you've lost half of your gold. <br /><br />You have been taken back to <a href=\"index.php\">Kingson</a> and treated for your wounds."; display("$page", "You have died.."); die(); //header("Location: index.php"); die; } } } else { $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); header("Location: index.php"); die(); }


-Sled

Top
#15742 - 09/26/07 06:41 PM Re: Bad Bug For Run Event + Fix!! [Re: Brendon]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Eh
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#15745 - 09/26/07 07:11 PM Re: Bad Bug For Run Event + Fix!! [Re: Fayt]
AnmanIndustries
Cookie Crisp
*****

Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth

Offline
First things first.

img src=\"images/races/{{gender}}/{{charrace}}_dead.jpg\

Someone tell me what is wrong with line as a fix for every one else.

Second things.

This has been done.. .tried... even by me... and has failed. I think doing this does minimise the frequency, but unfortuantly it doesnt remove it completly. Which also leads me to beleive the problem is two fold. But who knows. All I know, is I did something similar, as has other people, and it hasnt worked.
_________________________
If you want me to punch you in the nuts go to:
http://www.AnmanIndustries.com

I'll do it for free too. Enjoy.

Top
#15747 - 09/26/07 10:43 PM Re: Bad Bug For Run Event + Fix!! [Re: AnmanIndustries]
Brendon
Grape Nuts


Registered: 09/18/07
Posts: 40

Offline
works for me? and i said that u may need to alter it for your game ;\) that code is in my game..
Top
#15749 - 09/26/07 11:09 PM Re: Bad Bug For Run Event + Fix!! [Re: Brendon]
AnmanIndustries
Cookie Crisp
*****

Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth

Offline
Then, why dont you just remove that part completely.

back in the old days when this bug was still heavily discussed, we found that people who DID do this, still had it come up. But not as often. Youll see. Or maybe not. I only got maybe 3 reports of it after I fixed it. So it was pretty rare.
_________________________
If you want me to punch you in the nuts go to:
http://www.AnmanIndustries.com

I'll do it for free too. Enjoy.

Top
#15753 - 09/27/07 10:26 AM Re: Bad Bug For Run Event + Fix!! [Re: AnmanIndustries]
Brendon
Grape Nuts


Registered: 09/18/07
Posts: 40

Offline
because i dont give a shit about fixing someone elses game?
if they dont know proper php or dont have someone that knows it then why have the downloaded DK
lol

im just saying. heres a bug, heres my fix. do it yourself

Top
Page 1 of 1 1


Hop to:

se7enet

Barack Obama Logo