The following is part of a script I'm writing. With this code in I get the above error (read thread title). I've read through this many times and can't find the problem - it's definately in this piece of the code, as if I remove this piece it works fine - any suggestions ??
Code
----
if ($f1{style} =~ m/inside/gi) {
$fighter1{str}++;
if ($fighter1{str} > $fighter2{str}) {
$diff = (($fighter1{str} - $fighter2{str}) * 1.5);
$fighter1{str} = ($fighter1{str} + $diff);
}
$fighter1{agl} = (($fighter1{agl} / 10) * 9);
} elsif ($f1{style} =~ m/clinch/gi) {
$fighter1{agl}++;
if ($fighter1{str} > $fighter2{str}) {
$diff = (($fighter1{str} - $fighter2{str}) * 1.5);
$fighter1{agl} = ($fighter1{agl} + $diff);
}
$diff = ($f2{agr} / 5);
$f1{agr} = ($f1{agr} - $diff);
$f1{rst} = ($f1{rst} + $diff);
} elsif ($f1{style} =~ m/feint/gi) {
$fighter1{spd}++;
if ($fighter1{spd} > $fighter2{spd}) {
$diff = (($fighter1{spd} - $fighter2{spd}) * 1.5);
$fighter1{spd} = ($fighter1{spd} + $diff);
}
$f1{end}--;
} elsif ($f1{style} =~ m/counter/gi) {
$fighter1{str}++;
if (($fighter1{spd} + $fighter1{hgt}) > ($fighter2{spd} + $fighter2{hgt})) {
$diff = (($fighter1{spd} + $fighter1{hgt}) - ($fighter2{spd} + $fighter2{hgt}));
$fighter1{agl} = ($fighter1{agl} + (0.25 * $diff));
$test = $fighter2{agl};
if (($fighter2{agl} - (0.25 * $diff)) < ($test * 0.5)) {
$fighter2{agl} = ($fighter2{agl} * 0.5);
} else {
$fighter2{agl} = ($fighter2{agl} - (0.25 * $diff));
}
$f1{agr} = ($f1{agr} * 0.8);
} elsif ($f1{style} =~ m/ring/gi) {
$fighter1{agl}++;
if ($fighter1{agl} > $fighter2{agl}) {
$diff = ($fighter1{agl} - $fighter2{agl});
$fighter1{agl} = ($fighter1{agl} + ($diff * 1.5));
}
$f1{end}--;
} elsif ($f1{style} =~ m/ropes/gi) {
if ($fighter1{agl} > $fighter2{agl}) {
$diff = ($fighter1{agl} - $fighter2{agl});
if (($fighter2{agl} - ($diff * 0.5)) < 8) {
$fighter2{agl} = 8;
} else {
$fighter2{agl} = ($fighter2{agl} - ($diff * 0.5));
}
$fighter1{agl}--;
} elsif ($f1{style} =~ m/outside/gi) {
} elsif ($f1{style} =~ m/allout/gi) {
}
Thanks in advance !!
Darren Rathbone
Code
----
if ($f1{style} =~ m/inside/gi) {
$fighter1{str}++;
if ($fighter1{str} > $fighter2{str}) {
$diff = (($fighter1{str} - $fighter2{str}) * 1.5);
$fighter1{str} = ($fighter1{str} + $diff);
}
$fighter1{agl} = (($fighter1{agl} / 10) * 9);
} elsif ($f1{style} =~ m/clinch/gi) {
$fighter1{agl}++;
if ($fighter1{str} > $fighter2{str}) {
$diff = (($fighter1{str} - $fighter2{str}) * 1.5);
$fighter1{agl} = ($fighter1{agl} + $diff);
}
$diff = ($f2{agr} / 5);
$f1{agr} = ($f1{agr} - $diff);
$f1{rst} = ($f1{rst} + $diff);
} elsif ($f1{style} =~ m/feint/gi) {
$fighter1{spd}++;
if ($fighter1{spd} > $fighter2{spd}) {
$diff = (($fighter1{spd} - $fighter2{spd}) * 1.5);
$fighter1{spd} = ($fighter1{spd} + $diff);
}
$f1{end}--;
} elsif ($f1{style} =~ m/counter/gi) {
$fighter1{str}++;
if (($fighter1{spd} + $fighter1{hgt}) > ($fighter2{spd} + $fighter2{hgt})) {
$diff = (($fighter1{spd} + $fighter1{hgt}) - ($fighter2{spd} + $fighter2{hgt}));
$fighter1{agl} = ($fighter1{agl} + (0.25 * $diff));
$test = $fighter2{agl};
if (($fighter2{agl} - (0.25 * $diff)) < ($test * 0.5)) {
$fighter2{agl} = ($fighter2{agl} * 0.5);
} else {
$fighter2{agl} = ($fighter2{agl} - (0.25 * $diff));
}
$f1{agr} = ($f1{agr} * 0.8);
} elsif ($f1{style} =~ m/ring/gi) {
$fighter1{agl}++;
if ($fighter1{agl} > $fighter2{agl}) {
$diff = ($fighter1{agl} - $fighter2{agl});
$fighter1{agl} = ($fighter1{agl} + ($diff * 1.5));
}
$f1{end}--;
} elsif ($f1{style} =~ m/ropes/gi) {
if ($fighter1{agl} > $fighter2{agl}) {
$diff = ($fighter1{agl} - $fighter2{agl});
if (($fighter2{agl} - ($diff * 0.5)) < 8) {
$fighter2{agl} = 8;
} else {
$fighter2{agl} = ($fighter2{agl} - ($diff * 0.5));
}
$fighter1{agl}--;
} elsif ($f1{style} =~ m/outside/gi) {
} elsif ($f1{style} =~ m/allout/gi) {
}
Thanks in advance !!
Darren Rathbone