Skip to content

unportable-code: function mod on floating point #405

@GitMensch

Description

@GitMensch

I'm not sure what this code should do, but I fear it possibly doesn't.
In any case that's invalid COBOL.

stairs.cob, bed,cob, door.cob, trapdoor.cob, button.cob

        *> Use the player's yaw to determine the facing
        EVALUATE FUNCTION MOD(PLAYER-YAW(LK-PLAYER) + 45, 360)
            WHEN < 90
                MOVE "north" TO PLACE-PROPERTY-VALUE(2)
            WHEN < 180
                MOVE "east" TO PLACE-PROPERTY-VALUE(2)
            WHEN < 270
                MOVE "south" TO PLACE-PROPERTY-VALUE(2)
            WHEN OTHER
                MOVE "west" TO PLACE-PROPERTY-VALUE(2)
        END-EVALUATE

... also: this code (and likely surrounding one) exists multiple times, it should possibly be moved to a callable program or copybook as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions