07.01.2012, 10:26
Hy community,
I need your help/advice. I loaded crashdetect plugin to track down some errors in my script and somehow got into this problem:
The file float.inc is the standard file from samp(pawn) package.
the line 108 is:
The problem appears on something very basic like:
if I modify the script into:
The problem vanished.
Does anyone have any idea why this thing happens ?
Should I use Floatadd, Floatsub, Floatmul, Floatdiv functions instead of standard operators +,-,*,/ ?
My compile output is:
Thank you in advance,
Mike
I need your help/advice. I loaded crashdetect plugin to track down some errors in my script and somehow got into this problem:
pawn Code:
[13:05:08] Script[gamemodes/newegDB.amx]: In file 'I:\_eGaming\samp\_new_mysql-0.3d\__CORECTAT0.3c\pawno-3\include\float.inc' at line 108:
[13:05:08] Script[gamemodes/newegDB.amx]: Run time error 8: "Heap underflow"
[13:05:08] Error information:
[13:05:08] Heap index (HEA) is 0x8B, heap bottom (HLW) is 0x3F20FC
[13:05:08] Call stack (most recent call first):
[13:05:08] Stack corrupted!
the line 108 is:
pawn Code:
stock Float:operator-(Float:oper)
return oper^Float:cellmin; /* IEEE values are sign/magnitude */
pawn Code:
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health - 2.0);
pawn Code:
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatsub(health, 2.0));
Does anyone have any idea why this thing happens ?
Should I use Floatadd, Floatsub, Floatmul, Floatdiv functions instead of standard operators +,-,*,/ ?
My compile output is:
pawn Code:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 21152 bytes
Code size: 1581964 bytes
Data size: 4137212 bytes
Stack/heap size: 16384 bytes; estimated max. usage=1253 cells (5012 bytes)
Total requirements: 5756712 bytes
Done.
================ READY ================
Mike