For some reason, when I run this code, the turret kills anyone, even if they're supposed to be on the same team. Both turret types will be shown.
mob/Turret
icon = 'turret.dmi'
density = 1
Team = "Collective"
proc/Kill()
for(var/mob/M in oview(5))
if(M.FakeTeam != src.Team) //Faketeam is the person's team unless changed
M << "You are trespassing!"
M.HP = -1
M.DeathCheck()
spawn(10) Kill()
New()
spawn() Kill()
mob/TitanT
icon = 'turret.dmi'
density = 1
Team = "Titan"
proc/NPCKill()
for(var/mob/M in oview(5))
if(M.FakeTeam != src.Team) //Faketeam is the person's team unless changed
M << "You are trespassing!"
M.HP = -1
M.DeathCheck()
spawn(10) NPCKill()
New()
spawn() NPCKill()
It doesn't not work, it just kills teammates even though the purpose of it is to defend bases/meetings.
ID:149031
Jul 24 2002, 3:58 am
|
|
In response to Skysaw
|
|
Skysaw wrote:
Since the check if(M.FakeTeam != src.Team) is apparently returning true, the problem is not in the posted section. Okay, I've done that and found out that the problem comes, not from the turrets, but that the Combat Engineer class doesn't build turrets of the right team. Here is the code: mob [edit] I fixed it. But I want it not to kill automatically, which it does.[edit] |
Put in a nice debug check:
world << M.FakeTeam
world << src.Team
Just to make sure they are not equal.