Set max sprays to a CVar.

main
Kiri 2023-09-10 19:51:53 -07:00
parent f02ef045c1
commit b750dd6663
3 changed files with 10 additions and 2 deletions

View File

@ -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).

View File

@ -1,2 +1,3 @@
server int snektech_spawnflags = 11;
server int snektech_maxspraysperplayer = 10;
user string snektech_spraypattern = "SnekSpray_TransPride";

View File

@ -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();
}