csgo-retakes
csgo-retakes copied to clipboard
de_basalt SpawnType_NeverWithBomb spawns not working on b-site
Expected behavior
Any spawn that marked as never bomb carrier should not be selected as a possible spawn for a player holding the bomb.
Actual behavior
In basalt b site, if making a set of customs spawns and setting "never bomb carrier" spawns or "standard spawns" around B site will not follow usual logic. Any spawn will be valid for planting, regardless of type.
Steps to reproduce
- Plugin version: latest
- Sourcemod version: latest
- Steps to reproduce (please be specific):
- rcon map de_basalt
- sm_edit
- add T only spawns around b site with "never bomb carrier" and add a single spawn into planting area with "only bomb carrier"
- save spawns
- reload map
- play retakes, see planting happening outside of plant area
How to fix
The problem occurs in this code in spawns.sp:
public bool CanBombCarrierSpawn(int spawn) {
if (g_SpawnTeams[spawn] == CS_TEAM_CT)
return false;
return (g_SpawnTypes[spawn] != SpawnType_NeverWithBomb) && SpawnInsideBombSite(spawn);
}
Most likely, the SpawnInsideBombSite is returning a non existing area and the code ends up using the potentialSpawns.length = 0
fallback inside the SelectSpawn
function.
I'd agree with anyone that this it is kind of an anti pattern to fix this problem in this plugin, but it would definitely be a better and more universally applicable design to only have spawns that allow planting: SpawnType_OnlyWithBomb
and spawns that allow no planting: SpawnType_NeverWithBomb
and remove SpawnType_Normal
completely. With this, InsideBombSite checking could then entirely be removed. The addon doesn't need to care if someone puts their plant spawns outside of the area, it simply means they want it there. Allow for some misconfiguration to make the whole spawn system considerably simpler and elegant. It is also clear with de_ancient and de_basalt, that valve is no longer opting to include the proper bounding boxes for plantable areas anymore :(