* (Bugfix) Fixed DinkC sp_frame(x, -1) issue, where it would set the frame to 1 instead of getting the current frame. This issue was accidentally added in r1492 (sp_frame crash protection).

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1619 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
redink1 2018-06-05 23:52:58 +00:00
parent 63a9cfd094
commit 3957c689c2

View file

@ -9330,8 +9330,8 @@ pass:
int32 p[20] = {1,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
if (g_nlist[1] < 0 || g_nlist[1] >= C_MAX_SPRITE_FRAMES)
//Allow -1, in case a script needs to get the current frame.
if (g_nlist[1] < -1 || g_nlist[1] >= C_MAX_SPRITE_FRAMES)
{
LogMsg("sp_frame trying to set something to frame %d? Illegal, forcing to 1.", g_nlist[1]);
g_nlist[1] = 1;