ocean
icon_state = "sea"
Enter(mob/Player/M as mob)
if(M.onboat==0)
return 0
else
return 1
Works great! A player can't enter the ocean. Problem: The wave can't. Why is it trying to apply the mob/Player/M enter to Waves!?! My waves are a mob/Wave. Every time I get a 'M.onboat not defined'. A Wave doesn't have that var. Please help. Thanks in Advance
I believe Enter is taking the 'atom/Movable/O that gets passed to it, and is treating anything that gets passed as a /mob, because of the 'as mob'. I'm guessing it would treat objects the same way with this. Try:
ocean
Enter(atom/movable/O) // The default argument
if(istype(O, /mob/player)) //check to see if O is a player mob
var/mob/player/P = O //create a reference to a player mob, and assign O to it
if(!P.onboat) //If P is not on a boat
return 0 //Deny it entry
else
return ..() //Allow the default process to happen, in case some other code would deny access somewhere else in your code
sigh, dm tags made this a really wide message, so I took them out