HexenC Registers/Globals Overflow
Brought to you by:
acceptthis,
timeserv
When compiling a large HexenC project with FTEQCC -H2, the resulting progs shows strange behavior in-game: entities randomly change models, think/function calls get mixed up, monsters receive infinite health when damaged, etc. This behavior is the same as what happens with old HCC.EXE versions that did not support more than 65535 registers: opcode overflow. Here is my project:
https://github.com/Shanjaq/Hexen-2---Shadows-of-Chaos-fork/tree/master/portals
NOTE: Newer versions of HCC.EXE produce a v7 progs.dat, which functions normally as expected.
This is the slightly smaller project that does not include Shadows of Chaos code, it has the same issue though:
https://github.com/Shanjaq/uhexen2-apotheum/tree/master/portals
(Please use this instead of the repo linked in the original ticket! I could not edit the ticket and would have used this repo instead had I not already posted it.)
Screenshot attached of an entity that randomly changed its model to the Paladin axe upon executing one of its Think functions in p_dmatter.hc, around line 331
Last edit: Shanjaq Astraljam 2020-07-09
UPDATE: this appears to be caused by attempting to use the auto-generated "_x, _y, _z" vars from struct members of type Vector. hcc.exe handles this correctly, but there is a ticket open for the root cause in fteqcc.exe here:
https://sourceforge.net/p/fteqw/tickets/91/
confirmed fixed in r5736
Moved to https://github.com/fte-team/fteqw/issues/69