diff --git a/README.md b/README.md index af56f6b..3d4b796 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,11 @@ Shake before attempting to spray. Use firemode to select spray pattern. -Use the CVar snektech_spraypattern to directly set a spray pattern +Use the CVar `snektech_spraypattern` to directly set a spray pattern name. +Use the CVar `snektech_maxspraysperplayer` to set the number of images +each player can spray before old ones are no longer refreshed +(non-refreshed ones will eventually disappear). + + diff --git a/cvarinfo.txt b/cvarinfo.txt index 3e3ecb6..6ee6792 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -1,2 +1,3 @@ server int snektech_spawnflags = 11; +server int snektech_maxspraysperplayer = 10; user string snektech_spraypattern = "SnekSpray_TransPride"; diff --git a/zscript/spraycan.zs b/zscript/spraycan.zs index a443f52..2e5244b 100644 --- a/zscript/spraycan.zs +++ b/zscript/spraycan.zs @@ -408,7 +408,9 @@ class SnekTechSprayerDecalSpawner : Actor continue; } - if(otherSpawner.thisSprayerId < (thisSprayerId - 10)) { + int maxSpraysPerPlayer = + CVar.GetCVar("snektech_maxspraysperplayer").GetInt(); + if(otherSpawner.thisSprayerId <= (thisSprayerId - maxSpraysPerPlayer)) { if(otherSpawner.master == master) { otherSpawner.Destroy(); }