Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store and restore Sonja's inventory #14

Open
tdauth opened this issue Aug 31, 2022 · 0 comments
Open

Store and restore Sonja's inventory #14

tdauth opened this issue Aug 31, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tdauth
Copy link
Owner

tdauth commented Aug 31, 2022

It will only work if both are valid or we use an array with slots and item types to store it.
If only constants are allowed as array indices, it will be a long function.

Clear the inventory of the new Sonja:

func void Npc_ClearInventory(var instance n0)

Go through all items of the old Sonja with:

 int Npc_GetInvItemBySlot(var c_npc self, var int category, var int slotnr)

It returns the number of charges.
Use the global variable item to get the type.
Call this to add it the new Sonja:

func void CreateInvItems(var c_npc n0, var int n1, var int n2)
@tdauth tdauth self-assigned this Aug 31, 2022
@tdauth tdauth added the enhancement New feature or request label Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant