Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

de_basalt SpawnType_NeverWithBomb spawns not working on b-site #309

Open
shinkathe opened this issue Nov 11, 2021 · 0 comments
Open

de_basalt SpawnType_NeverWithBomb spawns not working on b-site #309

shinkathe opened this issue Nov 11, 2021 · 0 comments

Comments

@shinkathe
Copy link

shinkathe commented Nov 11, 2021

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):
  1. rcon map de_basalt
  2. sm_edit
  3. add T only spawns around b site with "never bomb carrier" and add a single spawn into planting area with "only bomb carrier"
  4. save spawns
  5. reload map
  6. 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 :(

@shinkathe shinkathe changed the title de_basalt never bomb carrier spawns not working on b-site de_basalt SpawnType_NeverWithBomb spawns not working on b-site Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant