Skip to content

Commit

Permalink
fix: spawn distance to enemy check (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov authored Sep 7, 2023
1 parent 776f0f1 commit aeb2290
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cstrike/addons/amxmodx/scripting/redm_spawns.sma
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,12 @@ static bool: Spawn_CheckConditions(const target, const targetTeam, const spawnId
if (disatanceToEnemy > searchDistance)
continue

spawnOrigin[2] += 17.0 // check the head
new Float: spawnHeadOrigin[3]
spawnHeadOrigin = spawnOrigin
spawnHeadOrigin[2] + 17.0 // check the head

if (mp_randomspawn_los) {
if (/* fm_is_in_viewcone(i, spawnOrigin) && */ fm_is_visible(i, spawnOrigin, true)) {
if (/* fm_is_in_viewcone(i, spawnOrigin) && */ fm_is_visible(i, spawnHeadOrigin, true)) {
return false
}
}
Expand Down

0 comments on commit aeb2290

Please sign in to comment.