TarCV / botc

Fork of Dusk's botc compiler *OPEN FOR ADOPTION*
Other
1 stars 0 forks source link

Zandronum reports stack size exceeded when Roam() is used (upgrade branch) #17

Closed ghost closed 4 years ago

ghost commented 4 years ago

Although #14 fixes tarcv-master, that fix doesn't work in the upgrade branch.

Crash entered the game.
bot Crash command: Random
bot Crash command: delay
bot Crash command: ChatSectionExistsInChatLump
bot Crash command: BeginChatting
bot Crash command: Random
bot Crash command: delay
You got the super shotgun!
You got the BFG9000!  Oh, yes.
bot Crash command: SayFromChatLump
Crash: Hey guys ;)
bot Crash command: LookForWeapons
bot Crash command: changestate
bot Crash command: StopChatting
bot Crash command: LookForWeapons
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: LookForPowerups
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: GetHealth
bot Crash command: GetBaseHealth
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: GetArmor
bot Crash command: GetBaseArmor
bot Crash command: LookForBaseArmor
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: LookForSuperHealth
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam
bot Crash command: LookForSuperArmor
bot Crash command: GetCurrentWeapon
bot Crash command: StringsAreEqual
bot Crash command: Roam

PushToStack: Stack size exceeded in bot Crash's script!
ghost commented 4 years ago

Temporary fix is to declare a variable and have the return value assigned to it, so: https://github.com/TarCV/botc/blob/eaf4f6059968b3649aacfcce4534ac8aaa877ae8/crashbot.botc#L479 Can be changed to something like:

int roaming;
roaming = Roam(MOVEMENT_SPEED);
TarCV commented 4 years ago

I've merged tarcv-master into this branch. So it should be fixed now.

ghost commented 4 years ago

It works now, closing issue.