Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Wretched on Wed 14/09/2005 14:40:10

Title: prevroom in start room (FIXED)
Post by: Wretched on Wed 14/09/2005 14:40:10
Version 2.7 . Is this a bug?

Manual says regarding prevroom:
QuoteGets the room number that the character was previously in. If the character is still in the room that they started in, this will be -1. Otherwise, it will be the room number of the room that they were last in.

Now when cEgo starts in room 99, and I put Display("%d",cEgo.prevroom); in playerenters room before fadein,
it displays 99. Not -1.

I want to use this to put default debug code in rooms so I can just start in a room , and if prevroom==-1  have everything setup for testing.

Title: Re: prevroom in start room
Post by: SSH on Wed 14/09/2005 14:48:33
Why not use:

if (DEBUG)

and CTRL-X to teleport to the room? debug mode enables the teleport and sets the #define DEBUG on
Title: Re: prevroom in start room
Post by: Wretched on Wed 14/09/2005 15:01:45
Sure I can, and have, made a work around. Point is that the debug code only runs if the character starts in the room. Anyway the bug report is the main issue here.
Title: Re: prevroom in start room
Post by: Pumaman on Thu 15/09/2005 21:47:27
Good point, well spotted ... I think this was actually a mistake in the manual where I wrote that by accident ... but it would be handy to have so I'll update the code to match what the manual says.

Edit by strazer:

AGS v2.71 Beta 6:
* Fixed the player character's PreviousRoom property starting off as the first room number, rather than -1 as it said in the manual.