Welcome to the Builder Academy

Question BUG empty container writes garbage to obj keywords

More
05 May 2025 00:58 #10695 by zi
If I drank everything out of a barrel (or any drink container) it would then push the last thing I typed into they keywords (as an imm and as a player) or garbage characters (the dreaded half diamond question mark))!

 I'm positive I was the cause, but couldn't track it. so I grabbed a fresh copy of tba and.. the same thing happened.

I saw a thread in 2020 and it looks like the 2025 code is updated, but the problem persists. I attached what I did in the updated TBA as "drinking problem" and my bug report from the crash in my mud.

Anyone replicate/verify?
Attachments:

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

More
06 May 2025 02:27 #10696 by Rumble
Reproducable. I never liked this stock behavior. When you empty a liquid container it removes a keyword. So name_from_drinkcon is likely buggy.

Try removing this from do_drink:
/* Remove liquid keyword */
name_from_drinkcon(obj);

Probably a good idea for us to remove name_from_drinkcon completely.

Anyone see a reason to keep this?

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
The following user(s) said Thank You: zi

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

More
06 May 2025 20:59 - 06 May 2025 21:14 #10697 by thomas
The reason is that if you drink from a bottle of water, you can "drink water". Once the container is empty, it is just a bottle, and "drink water" makes no sense. Once you fill it with wine, "drink water" is misleading, and you want to be able to  "drink wine".

The problem seems to be that, instead of just altering _this instance_ of the container, it frees the prototype, too. I think it's an easy fix.

Edit: Indeed, it was:  github.com/tbamud/tbamud/pull/149
Last edit: 06 May 2025 21:14 by thomas.
The following user(s) said Thank You: zi

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

More
12 May 2025 22:43 #10698 by cunning
personally, i hate it. I constantly get errors from it. i also think we need to remove name_to_drinkcon

otherwise we would have large ass keyword lists.

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

More
Yesterday 05:12 #10699 by thomas
You do realize I fixed it, right?

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

More
Yesterday 18:33 #10700 by Rumble
Thanks for the fix Thomas. I understand Cunning's point. I have corrected dozens of these SYSERR over the decades:
"SYSERR: Object # (oedit-s-desc) doesn't have drink type as last alias."
Because builders do not know about this functionality. So why keep it if only a few people who have been deep in the code understand it.

I asked Grok and it gave me the helpfile I created:
"In order for shops to display a jug as 'a jug of <drink type>' they must have the drink type as the last alias. It is good practice to put the drink type as the first and last word of an objects namelist (older versions of CircleMUD expect it first and once the object is empty it removes one of the drink aliases)."

I am fine either way.

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

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

Time to create page: 0.257 seconds