Spawning at location prior to spawn, not on spawn points

Hi

I have an issue in my gamemode where you spawn on the location you were on prior to being respawned, where as it should spawn you on the map’s spawnpoints

I don’t know what could cause this issue, I am not overwriting PlayerSpawn ( I have two hooks on it but they return nothing )

this is the code I use to swap the teams



local function SwapTeams()
	local hunters = team.GetPlayers(TEAM_HUNTERS)
	local props = team.GetPlayers(TEAM_PROPS)

	for _, v in pairs(hunters) do
		if( IsValid(v) ) then
			RemovePlayerProp( v )
			player_manager.SetPlayerClass( v, "player_prop" )
			v:SetTeam( TEAM_PROPS )
			v:KillSilent()
			v:Spawn()
		end
	end

	for _, v in pairs(props) do
		if( IsValid(v) ) then
			RemovePlayerProp( v )
			player_manager.SetPlayerClass( v, "player_hunter" )
			v:SetTeam( TEAM_HUNTERS )
			v:KillSilent()
			v:Spawn()
		end
	end
end 


[editline]20th August 2014[/editline]

So I just realized this also only happens on certain maps, like ph_restaurant.

it doesn’t happen on cs_office

here’s the code for how I create teams and chose spawnpoints



function GM:CreateTeams( )
	team.SetUp( TEAM_PROPS , "Props" , TEAM_PROPS_CHAT_COLOR, true )
	team.SetUp( TEAM_HUNTERS , "Hunters" , TEAM_HUNTERS_CHAT_COLOR, true  )
	team.SetUp( TEAM_SPECTATOR , "Spectators" , Color( 127, 127, 127 ), true  )
	team.SetClass( TEAM_PROPS, {"player_prop"})
	team.SetClass( TEAM_HUNTERS, {"player_hunter"})
	team.SetClass( TEAM_SPECTATOR, {"player_spectator"})
	team.SetSpawnPoint( TEAM_PROPS, {"info_player_terrorist", "info_player_rebel", "info_player_deathmatch", "info_player_allies"} )
	team.SetSpawnPoint( TEAM_HUNTERS, {"info_player_counterterrorist", "info_player_combine", "info_player_deathmatch", "info_player_axis"} )
	team.SetSpawnPoint( TEAM_SPECTATOR, {"info_player_counterterrorist", "info_player_combine", "info_player_deathmatch", "info_player_axis"} )
end