Skip to content
This repository was archived by the owner on May 13, 2020. It is now read-only.
This repository was archived by the owner on May 13, 2020. It is now read-only.

removeItem() not working? #6

@arkose

Description

@arkose

Hello! I am finding that character.inventory.removeItem() does not work, at least for me. Here is a short story that should show that removeItem() doesn't work:

Home

You are standing in a grassy field.
<%if(!character.inventory.hasItem("sword")){%>
A sword lies here.
[[Take sword.|Take]]
<%}else{%>
You wield a sword.
[[Drop sword.|Drop]]
<%}%>

Take

<%character.inventory.addItem("sword");%>
You take the sword.
[[Continue.|Home]]

Drop

<%if(character.inventory.removeItem("sword")){%>
You put the sword down.
<%}else{%>
ERROR: character.inventory.removeItem("sword") failed!
character.inventory.indexOf("sword") is <%=character.inventory.items.indexOf("sword")%>.
<%}%>
[[Continue.|Home]]

This will print:

ERROR: character.inventory.removeItem("sword") failed! character.inventory.indexOf("sword") is -1.

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