Murder...

Started by Darth Sidious, April 06, 2004, 11:26:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darth Sidious

 This is really starting to impede gameplay. I can only murder leaders!

This goes beyond a minor bug. BAXX has been on Reg for almost a month, and still no-one can use murder. Murder has always been an important strategic thing and it has now been eliminated.

Here is what I did to fix it... It works...

if ($uratio > ($eratio * 1.15))
{
 SpellSucceed("You have eliminated a portion of your opponent's $cterms[army]!");
 if ($enemy[shield] > $time) {
 $dam = .01;
 }
 else {
 $dam = .03;
 }
 $enemy[armtrp] -= round($enemy[armtrp] * $dam);
 $enemy[lndtrp] -= round($enemy[lndtrp] * $dam);
 $enemy[flytrp] -= round($enemy[flytrp] * $dam);
 $enemy[seatrp] -= round($enemy[seatrp] * $dam);
 $enemy[wizards] -= round($enemy[wizards] * $dam);
 if ($enemy[shield] > $time)
 {
  SpellShielded();
  addNews(202,$users,$enemy,"success:yes;sheild:yes");
 }
 else addNews(202,$users,$enemy,"success:yes;sheild:no");
 $users[offsucc]++;
}
else
{
 SpellFail("");
 addNews(202,$users,$enemy,"success:no");
 $enemy[defsucc]++;
}
saveUserDataNet($enemy,"networth armtrp lndtrp flytrp seatrp  wizards");
}


Can't you just do something like that as a temporary fix?[/i]
user posted image

sh0e

 *this is wrong.. remanents of c/c++ and lack of time spent on php
i found the real culprit below*

thats a terrible way to do it to say the least..

i think i know the problem:
magicfun.php:   $shmod = 1/3;

talk about bad mistakes.. thats an integer computation and returns 0

is murder the only spell that doesnt work right?

Darth Sidious

 As far as I know, yes.

Thanks for that... Now I can go back to the old system... Instead of my inefficiant one.
user posted image

sh0e

 --stripped--
    o_O

Darth Sidious

 Hm... But still, Retto could just do a sloppy quick fix right now. It really impedes gameplay.
user posted image

sh0e


sh0e

 ok i was completely off and feel like an idiot.. i forgot that php has a different behavior than c in this
i guess thats what happens when you try to go on a whim without testing

while (list($key,$val) = each($trplst))
$enemy[$trp] = round($enemy[$trp] * $dam);

the real problem is that $trp doesnt exist
$trp should be $val or $val should be $trp

corrected code:
while (list($key,$trp) = each($trplst))
$enemy[$trp] = round($enemy[$trp] * $dam);