From e82101d9cb6e35cd8a5de32ab65525da60ad04e6 Mon Sep 17 00:00:00 2001 From: emmie Date: Wed, 13 Sep 2023 06:32:15 +0000 Subject: [PATCH] spraycan: actually explain SpawnDecal arg0 thing --- zscript/spraycan.zs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zscript/spraycan.zs b/zscript/spraycan.zs index 950f2d3..4ebe06a 100644 --- a/zscript/spraycan.zs +++ b/zscript/spraycan.zs @@ -405,9 +405,11 @@ class SnekTechSprayerDecalSpawner : Decal } } - // pass the decal name as a map editor type of argument - args[0] = -int(name(actualDecalName)); - // spawn the decal + // SpawnDecal checks arg0 for the decal ID/name. + // gzdoom passes string arguments as negated string table indices, so + // we need to cast the decal name to a Name (implicitly adding it to + // the string table), then to an int (to get the index). + args[0] = -int(Name(actualDecalName)); Super.SpawnDecal(); // then find every decal that we spawned