Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002072Core InformPhrases and functional programmingpublic2018-09-06 00:172018-09-06 19:32
ReporterEleas 
Assigned To 
PrioritynormalSeveritymildReproducibilityalways
StatusconfirmedResolutionopen 
Platformx86OSWindowsOS Version7
Product Version6M62 
Target VersionFixed in Version 
Summary0002072: Truth state properties accessed without specifier ("the x" rather than "the x of [thing]) always return true
DescriptionI'm unsure if this is proper behavior. My uninformed guess is that the phrase looks for the variable in the wrong place and just grabs a word.

Regardless, this is an easy mistake for an author to make. Attempting to access a property as if it was a global variable should probably give a warning.
Minimal Source Text To Reproduce
Jane is a woman. Jane has a truth state called x. X is false.
Check jumping when x is true: say "How peculiar!".
[Check jumping when x of Jane is false: say "Fixed."]

There is a room. Test me with "jump".
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0004800)
zarf (developer)
2018-09-06 19:29

This is definitely a bug, and it occurs for any property type. A more general test case:

Jane is a woman.
Jane has a truth state called x.
Jane has a text called y.

When play begins:
	if x is true:
		say "Peculiar 1.";
	if y is "yyy":
		say "Peculiar 2.";


The generated I6 code looks like:

    ! [2: if x is true]
    if ((((p15_x && true) == (1 && true))))
    {! [3: say ~Peculiar 1.~]
        say__p=1;! [4: ~Peculiar 1.~]
        ParaContent(); print "Peculiar 1."; new_line; .L_Say1; .L_SayX1;}
    ! [5: if y is ~yyy~]
    if (((p16_y == TX_L_45)))
    {! [6: say ~Peculiar 2.~]
        say__p=1;! [7: ~Peculiar 2.~]
        ParaContent(); print "Peculiar 2."; new_line; .L_Say2; .L_SayX2;}
        rfalse;


The property constants p15_x and p16_y are being used nonsensically.
(0004801)
zarf (developer)
2018-09-06 19:32

Interestingly, the expressions are being type-checked. That is, if you test "if y is true", you get:

In the sentence 'if y is true' , it looks as if you intend 'y is true' to be a condition, but that would mean comparing two kinds of value which cannot mix - a texts valued property and a truth state - so this must be incorrect.

So I guess it's incorrectly allowing "texts valued property" to mix with "text".

- Issue History
Date Modified Username Field Change
2018-09-06 00:17 Eleas New Issue
2018-09-06 19:29 zarf Note Added: 0004800
2018-09-06 19:29 zarf Status new => confirmed
2018-09-06 19:32 zarf Note Added: 0004801


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker