Welcome to the Builder Academy

Question Waterskin problem

More
11 Apr 2021 21:18 #9820 by JTP
Replied by JTP on topic Waterskin problem
Any idea about why it fails if there is water in the name like waterskin...when i renamed it to skin. Then no problems

Please Log in or Create an account to join the conversation.

More
11 Apr 2021 23:10 #9821 by thomas
Replied by thomas on topic Waterskin problem
Please make sure you have the newest version of remove_from_string()

github.com/tbamud/tbamud/blob/dceb563a9b...f5/src/utils.c#L1510

I seem to remember this being a problem in an earlier version.

Please Log in or Create an account to join the conversation.

More
12 Apr 2021 20:10 #9824 by JTP
Replied by JTP on topic Waterskin problem
I dont even have remove_from_string

Please Log in or Create an account to join the conversation.

More
13 Apr 2021 06:40 #9825 by Rumble
Replied by Rumble on topic Waterskin problem
I remember this issue as well. Every water container was required to have the drink type as an alias/keyword and there was a SYSERR when it didn't. It was annoying, I'm glad we removed it. I assume the original purpose was so when you drank all of your <liquid> you could no longer drink from it but still drink <container alias> to get the empty message.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
13 Apr 2021 06:44 - 13 Apr 2021 08:09 #9826 by JTP
Replied by JTP on topic Waterskin problem
Well I did have water in alias

But now when it’s empty it’s like it doesn’t exists...I can’t refill it. I can’t examine it..it’s like it has a new name..

Thomas talks about remove_from_string

But my version must be old because I don’t have that


and why is it only is the item is called water skin...there is no problems with a jug or cup or barrel ?
Last edit: 13 Apr 2021 08:09 by JTP.

Please Log in or Create an account to join the conversation.

More
13 Apr 2021 20:25 - 13 Apr 2021 20:26 #9828 by thomas
Replied by thomas on topic Waterskin problem
The problem is that you have an object with the alias "water waterskin" and the algorithm, when you empty the container, will try to remove the "water" alias from the list.
So it removes "water", and checks the resulting list of names ("waterskin") again. And it finds the word "water" inthere.
In an older version of the codebase there is a bug here, that results in not checking the length of the words to remove. So, if the word contains "water", all of it is removed.

Now, if you do the same with a cup, which has the alias list "cup water", once it has removed the "water" keyword, you still have "cup".
Once you fill it again, it will get the fluid name appended to the alias list again. So if you have a cup of water ("cup water") and empty it ("cup") and then fill it with firebreather, you'll get a "cup firebreather".

This is why it works with cups, but not your waterskin.

The bug is fixed in the current version, as far as I know.
Last edit: 13 Apr 2021 20:26 by thomas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.253 seconds