duplicator.GenericDuplicatorFunction() improvements #2169
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
duplicator.GenericDuplicatorFunction()
now runsPlayerSpawnSENT
andPlayerSpawnedSENT
, similar toMakeProp()
.This change will fix the duplicator ignoring
sbox_maxsents
and will allow you to dynamically control whether specific entities can be duped without having to define a factory function (or worse, redefine it). It also makes duping SENTs more consistent with duping props and other things as they do run their respectivePlayerSpawn*
hooks when duped.Possible issues: can't find any. Spawning default entities and random workshop dupes seems to be working as expected (e.g. nothing is counting towards 2 limits at the same time)
Further changes: update wiki pages for
PlayerSpawn*
hooks to reflect that they are ran not only when things are spawned from the Q menu. You could also add abool Duplicated
argument to these hooks, or maybe evenstring SpawnMethod
(= "spawnmenu","duplicator", "some_custom_method") to allow modders to add and control custom spawn methods organically.