Welcome to the Builder Academy

Question Error Log Cleanup

More
08 Sep 2012 20:58 - 11 Sep 2012 14:15 #780 by Rumble
Error Log Cleanup was created by Rumble
So every few months I go through TBA's /log folder and make sure none of the log files are out of control and to clean up log/errors. FYI we limited all log files to 5000 lines a while back since they could fill up rather quickly in certain cases.

Anyways I came across the typical "mob using char data" error, but this one was repeated a few thousand times so I fixed it. A lot of these SYSERR's have popped up due to mob triggers having mobs do player actions. This one was in can_take_obj since we removed weight limitations on players with nohassle. The code is here:
Code:
static int can_take_obj(struct char_data *ch, struct obj_data *obj) { if (!(CAN_WEAR(obj, ITEM_WEAR_TAKE))) { act("$p: you can't take that!", FALSE, ch, obj, 0, TO_CHAR); return (0); } if (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) { if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) { act("$p: you can't carry that many items.", FALSE, ch, obj, 0, TO_CHAR); return (0); } else if ((IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj)) > CAN_CARRY_W(ch)) { act("$p: you can't carry that much weight.", FALSE, ch, obj, 0, TO_CHAR); return (0); } }
Here is my reasoning in the changelog:
Added a !NPC check to can_take_object. It was spamming a "mob using player data SYSERR". This means mobs do not have a max weight carrying capacity anymore. I think this is a good thing because I've seen people stumped when mob triggers fail due to weight limitations. But it could be unbalancing on some MUDs since pets could then carry unlimited gear.

I just wanted to let everyone know in case they think this is unbalancing to their MUD. Feel free to reply back if you agree or disagree.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
Last edit: 11 Sep 2012 14:15 by Rumble.

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

More
09 Sep 2012 15:34 #782 by thomas
Replied by thomas on topic Re: Error Log Cleanup
Might I suggest you move the check for !IS_NPC a bit - as the bug is fixed now, mobs can take non-take items...

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

More
11 Sep 2012 14:16 #783 by Rumble
Replied by Rumble on topic Re: Error Log Cleanup
Thanks, updated above.

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.184 seconds