ID:138328
 
mob
var
GM_lockmove = 0

Move()
if(usr.GM_lockmove)
return 0
. = ..()

Login()
if(banned.Find(usr.ckey))
usr << "You've been banned. Nice try, though."
del(usr)
else
. = ..()

var
banned[0]

This little snippet from s_admin seems to locate me to world.maxx, world.maxy, world.maxz instead of the normal position. If I remove this code, I appear normally in the first available position near 1,1,1. Could someone tell me what's going on?
On 10/27/00 8:08 pm Spuzzum wrote:
This little snippet from s_admin seems to locate me to world.maxx, world.maxy, world.maxz instead of the normal position. If I remove this code, I appear normally in the first available position near 1,1,1. Could someone tell me what's going on?

Your Move() is denying all entry (lockmove=0), so the server is just sticking your guy at the last place it checked, which would be world.maxx,maxy,maxz. I'm not quite sure it why it isn't just excluding your guy from the map entirely, though.
In response to Tom H.
Your Move() is denying all entry (lockmove=0),

But how? My code checks to see if GM_lockmove is true, and the variable is initialised to false

mob
var
GM_lockmove = 0 //is false

Move()
if(usr.GM_lockmove) //if true
return 0 //return
. = ..() //otherwise do the normal thing
In response to Spuzzum
On 10/28/00 12:41 pm Spuzzum wrote:
Your Move() is denying all entry (lockmove=0),

But how? My code checks to see if GM_lockmove is true, and the variable is initialised to false

mob
var
GM_lockmove = 0 //is false

Move()
if(usr.GM_lockmove) //if true
return 0 //return
. = ..() //otherwise do the normal thing


I dunno...but how about using

return ..()

as a more readable way to call the superclass?

[Deadron code clarity hot button #428...]
In response to Deadron
I dunno...but how about using

return ..()

as a more readable way to call the superclass?

Because in the last release, the game would freeze entirely if I did that... I suspected an infinite loop.
On 10/27/00 8:08 pm Spuzzum wrote:
mob
var
GM_lockmove = 0

Move()
if(usr.GM_lockmove)
return 0
. = ..()

Login()
if(banned.Find(usr.ckey))
usr << "You've been banned. Nice try, though."
del(usr)
else
. = ..()

var
banned[0]

So do you have any idea what the problem here is? GM_lockmove is checked if it is true, so it can't be that.
In response to Spuzzum
On 10/30/00 4:08 pm Spuzzum wrote:

So do you have any idea what the problem here is? GM_lockmove is checked if it is true, so it can't be that.

I think the code is fine. I plugged it in verbatim to a world with a map and I got put into (1,1,1) as expected. You must be overriding it somewhere else. Just put some debugging info in to see where it goes bad.
In response to Tom H.
On 10/30/00 4:29 pm Tom H. wrote:
On 10/30/00 4:08 pm Spuzzum wrote:

So do you have any idea what the problem here is? GM_lockmove is checked if it is true, so it can't be that.

I think the code is fine. I plugged it in verbatim to a world with a map and I got put into (1,1,1) as expected. You must be overriding it somewhere else. Just put some debugging info in to see where it goes bad.

Well, that's directly from Spuzzum's Administrative Library. I'm certain I don't override Move() anywhere else, and it locates me to maxx, maxy, maxz in every game I play using that library.
In response to Spuzzum
On 10/30/00 10:29 pm Spuzzum wrote:

Well, that's directly from Spuzzum's Administrative Library. I'm certain I don't override Move() anywhere else, and it locates me to maxx, maxy, maxz in every game I play using that library.

Look at the s_admin.dm code Spuzz. Your Move() proc doesn't return anything (ie just does ..()) so by default you are getting a return of 0.
In response to Tom H.
On 10/30/00 11:23 pm Tom H. wrote:
On 10/30/00 10:29 pm Spuzzum wrote:

Well, that's directly from Spuzzum's Administrative Library. I'm certain I don't override Move() anywhere else, and it locates me to maxx, maxy, maxz in every game I play using that library.

Look at the s_admin.dm code Spuzz. Your Move() proc doesn't return anything (ie just does ..()) so by default you are getting a return of 0.

Here's the change, and it still doesn't work.

mob
var
GM_lockmove = 0

Move()
if(usr.GM_lockmove)
return 0
return ..()

Login()
if(banned.Find(usr.ckey))
usr << "You've been banned. Nice try, though."
del(usr)
else
..()
In response to Spuzzum
On 10/31/00 9:24 pm Spuzzum wrote:

Here's the change, and it still doesn't work.

What? It works for me! (that's the version I tested in my basic world with a map) Are you certain??

Put some debugging info in. Tell me what is getting reached. That's the only way to figure these things out. My guess is that the Move() proc isn't even getting called (because some other version is overriding it). Comment it out entirely and see. Or put some print statements in. All In know is that this version works fine for me when I test it.