Code center > Bug reports

Borg's runtime error

(1/3) > >>

Griz:
Borg!
finally got the error 6 after running many trials.
used version 2.37.6 ...
with the error trapping added and recompiled.
it saved an error.sim ...
which I will attach as Borgerror.sim.zip

reloaded into the VB version for debug.

in Public Sub lookoccurr ...
the debug break occurs near the end of the routine in line:

rob(n).mem(825) = rob(n).venom

rob(n).mem(827) = rob(n).poison
End Sub

n=159
rob(n).mem(825) = 32751
rob(n).venom = 32801

I find venom dimensioned in a number of moduals as:
venom As Single
and in other's it is capped at 32000.

so ... what to do?
PY?
Nums?

I put this in just ahead of the line above ...
If rob(n).venom > 32000 Then rob(n).venom = 32000
as a temp workaround.
reloaded the Borkerror.sim ...
no error. [yet] ;)
and it is running again now

stay tuned. ;)

Numsgil:
That fix looks like it would work just fine.

Griz:

--- Quote ---That fix looks like it would work just fine.
--- End quote ---
but it's just a patch, a band-aid .... not a fix.
DB is too full of these 'temp fixes' as is, imo.
pretty soon one runs out of fingers to stick into every
little hole that springs in the dike, or altering one thing
pulla a different band-aid off in another place.
treating the symptom, not the disease.
so what is the 'cause' of .venom ever going above 32000?
that's the thing to sus out, eh?

but ... at this point ...
iyo ... would it be better to do this line here ...
or to dimension rob(n).venom, or venom as Double?
what saves in time?
I would think that having to check if it's >32000 for
every bot would not be the ideal thing to do here ...
while the extra dimensioning would result in greater mem use.
so there is a tradeoff, eh?
or ... in the best of all worlds ...
to find and 'fix' the problem.

Numsgil:

--- Quote ---
--- Quote --- That fix looks like it would work just fine.
--- End quote ---
but it's just a patch, a band-aid .... not a fix.
DB is too full of these 'temp fixes' as is, imo.
--- End quote ---
Right, so that's why I'm rewritting it.

Don't change any of the variable type declarations, that sort of things usually ends up causing more problems than it solves.  Right before the crash add a line to cap venom at 32000.  That should fix it well enough I think.

PurpleYouko:
I would be interested to find out at what point of the program, venom is being added to push it over 32000. There are only a small number of places where this can happen so it shouldn't be too hard to trackdown.

I don't like band-aid fixes either.

Navigation

[0] Message Index

[#] Next page

Go to full version