- Posts: 937
- Thank you received: 17
Waterskin problem
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
2 years 1 month ago #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.
- Rumble
-
- Offline
- Administrator
-
2 years 1 month ago #9825
by Rumble
Rumble
The Builder Academy
tbamud.com 9091
This email address is being protected from spambots. You need JavaScript enabled to view it.
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 937
- Thank you received: 17
2 years 1 month ago - 2 years 1 month ago #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 ?
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: 2 years 1 month ago by JTP.
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 816
- Thank you received: 159
2 years 1 month ago - 2 years 1 month ago #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.
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: 2 years 1 month ago by thomas.
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 937
- Thank you received: 17
2 years 1 month ago #9829
by JTP
Replied by JTP on topic Waterskin problem
Is there a patch just to fix this ? So I can maybe change my code
Or is it a longer process ?
Or is it a longer process ?
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 816
- Thank you received: 159
2 years 1 month ago #9830
by thomas
Replied by thomas on topic Waterskin problem
Good question. It's all in this commit: github.com/tbamud/tbamud/commit/dceb563a...381823ff201a404ab6f5
Please Log in or Create an account to join the conversation.
Time to create page: 0.106 seconds