Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001351I6 LibraryGeneralpublic2014-06-29 03:022014-06-29 03:32
ReporterDavidG 
Assigned ToDavidG 
PrioritynormalSeverityseriousReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version6/12 
Target Version6/12Fixed in Version 
Summary0001351: Giving orders to your former self causes stack overflow
DescriptionIf you switch bodies, then order your former self to do something, the game crashes with a stack overflow.
Minimal Source Text To Reproduce
Constant DEBUG;
Constant STORY "Selves: An investigation of switching bodies.^";
Include "parser.h";
Include "verblib.h";
Include "Grammar";

[ Initialise;
	location = theroom;
	player.narrative_voice = 3;
	player.short_name = "George";
	player.name = 'George';
	player.nameless = false;
];

Object theroom "The Room"
	with description "This is just a plain room like any other.",
	has light;

Object -> Box "box"
	with name 'box',
	description "It's a big wooden box with a lock.",
	with_key Key,
	has container openable enterable lockable;

Object -> Key "key"
	with name "key",
	description "It's an ordinary looking key.";

Object -> Hat "hat"
	with name 'hat',
	description "Just an ordinary hat.",
	has clothing;

Object -> Table "table"
	with name "table",
	capacity 2,
	has supporter;

Object -> -> Button "button"
	with name 'button',
	description "An unlabeled button.",
	before [;
	  Push:
		if (player == Kitty)
			ChangePlayer(selfobj);
		else
			ChangePlayer(Kitty);
		"You feel strange and suddenly you realize you're in a 
		different body.";
	],
	has static;


Object -> Kitty "Kitty"
	with name "kitty" "cat",
	short_name "Kitty",
	description "Kitty is a cute kitty-cat.",
	narrative_voice 3,
	orders [;
	Take:	<<take noun, actor>>;
	Give:	<<give noun second, actor>>;
	Drop:	<<drop noun, actor>>;
	Go:	<<go noun, actor>>;
	Open:	<<open noun, actor>>;
	Close:	<<close noun, actor>>;
	Enter:	<<enter noun, actor>>;
	Wear:	<<wear noun, actor>>;
	],
	has female proper animate transparent;

Verb 'who'
	* 'am' 'i'	-> WhoAmI;

[WhoAmISub;
	"You are ", (string) player.short_name, ".";
];
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0002907)
DavidG (developer)
2014-06-29 03:28

This appears to be related to my confusion expressed in this post: http://www.intfiction.org/forum/viewtopic.php?f=7&t=14471. [^]

If I prefix Kitty's order action code with "if (self ~= player)", then ordering George to do something will return the expected "George has better things to do.".

This is not something the Library should keep track of.

- Issue History
Date Modified Username Field Change
2014-06-29 03:02 DavidG New Issue
2014-06-29 03:02 DavidG Status new => assigned
2014-06-29 03:02 DavidG Assigned To => DavidG
2014-06-29 03:03 DavidG Steps to Reproduce Updated View Revisions
2014-06-29 03:06 DavidG Steps to Reproduce Updated View Revisions
2014-06-29 03:28 DavidG Note Added: 0002907
2014-06-29 03:32 DavidG Status assigned => closed
2014-06-29 03:32 DavidG Resolution open => no change required


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker