diff --git a/polymer/eduke32/samples/a.m32 b/polymer/eduke32/samples/a.m32 index f6281787c..82c6a7e0f 100644 --- a/polymer/eduke32/samples/a.m32 +++ b/polymer/eduke32/samples/a.m32 @@ -1268,6 +1268,22 @@ defstate chselshade } ends +defstate listusedtags + for i allsprites + { + getspritelinktype i k + + ifn k 0 + { + ife k 1 + qsprintf TQUOTE "sprite %d lotag %d" i sprite[i].lotag + else ife k 2 + qsprintf TQUOTE "sprite %d hitag %d" i sprite[i].hitag + quote TQUOTE + } + } +ends + ////////// USER AREA ////////// // key settings diff --git a/polymer/eduke32/source/m32def.c b/polymer/eduke32/source/m32def.c index 705fe1147..3553b3f82 100644 --- a/polymer/eduke32/source/m32def.c +++ b/polymer/eduke32/source/m32def.c @@ -303,13 +303,14 @@ const char *keyw[] = "ifaimingsector", "ifinteractive", -// BUILD functions +// Mostly BUILD functions "resetkey", "setkey", "insertsprite", "dupsprite", "tdupsprite", "deletesprite", + "getspritelinktype", // not BUILD "lastwall", "updatecursectnum", "updatesector", @@ -2845,6 +2846,7 @@ repeatcase: return 0; case CON_SQRT: + case CON_GETSPRITELINKTYPE: { // syntax sqrt // gets the sqrt of invar into outvar diff --git a/polymer/eduke32/source/m32def.h b/polymer/eduke32/source/m32def.h index 676716311..15ac98f7b 100644 --- a/polymer/eduke32/source/m32def.h +++ b/polymer/eduke32/source/m32def.h @@ -458,6 +458,7 @@ enum ScriptKeywords_t CON_DUPSPRITE, CON_TDUPSPRITE, CON_DELETESPRITE, + CON_GETSPRITELINKTYPE, CON_LASTWALL, CON_UPDATECURSECTNUM, CON_UPDATESECTOR, diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index ef8bf7b92..9ee563bfe 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -1733,6 +1733,16 @@ badindex: } continue; + case CON_GETSPRITELINKTYPE: + insptr++; + { + int32_t spritenum=Gv_GetVarX(*insptr++), resvar = *insptr++; + + X_ERROR_INVALIDSPRI(spritenum); + Gv_SetVarX(resvar, taglab_linktags(1, spritenum)); + } + continue; + case CON_LASTWALL: insptr++; {