Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Odd bug with ints

Odd bug with ints

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Dace K   Canada  (169 posts)  Bio
Date Fri 07 Apr 2006 04:35 AM (UTC)

Amended on Fri 07 Apr 2006 04:36 AM (UTC) by Dace K

Message
In the pc_data struct, I have the following defined:

	int		missiondata[18];
	int		gquest[18];
	int			score;	/* current player score */



For some reason, it's reading missiondata[18] as gquest[0], and gquest[18] as score.

Any thoughts?

Missiondata is saved in the pfile, gquest and score are not.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Fri 07 Apr 2006 04:39 AM (UTC)
Message
What is reading what as what where? Your question makes no sense to me. :-P

Maybe you're reading into position 18, which is in fact the next data member; for instance gquest[18] is in fact score because it's one past the legal array size.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #2 on Fri 07 Apr 2006 04:51 AM (UTC)

Amended on Fri 07 Apr 2006 04:54 AM (UTC) by Dace K

Message
Oh, WHOOPS. :/.

These should be defined with [19], shouldn't they? :P

What I meant was, the value assigned for gquest[18] was the value supposed to be used as score.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Fri 07 Apr 2006 07:08 AM (UTC)
Message
They should be defined as [19] if you want there to be 19 elements: #0, #1, #2, ..., #18. I don't know what you're doing with them so I'm not sure what the right answer is here...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #4 on Fri 07 Apr 2006 03:31 PM (UTC)
Message
Yeah, it is.
Thanks - I can't believe I didn't see that :P

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,759 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.