Jump to content

Vampire Bat may not be spawned when player is on water


KXWl1
  • DLC VERSION - IMPORTANT!: Hamlet Pending

Vampire Bat may not be spawned when player is on water (this happens when the player is always on boat before the vampire bat's shadow could appear), this is wrong as the vampire bat is flying mobs and thus can cross land-water border:

function Batted:GetSpawnPoint(pt)
    local theta = math.random() * 2 * PI
    local radius = BAT_SPAWN_DIST

	local offset = FindWalkableOffset(pt, theta, math.random()*radius, 12, true) --12

	if offset then
		local pos = pt +offset

		local ground = GetWorld()
	    local tile = GROUND.GRASS
	    if ground and ground.Map then
	        tile = self.inst:GetCurrentTileType(pos:Get())

		    local onWater = ground.Map:IsWater(tile)
		    if not onWater then 
		    	return pos
		    end 
	    end
	end
end

 


Steps to Reproduce

1. Waits for the next vampire bat attack.

2. DO NOT get off the boat.

3. Notice that the vampire bat may not be spawned.




User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...