Welcome to the Builder Academy

Question TBA-2020 Bug Fix Request

More
02 Mar 2020 08:10 #8605 by Castillo
Replied by Castillo on topic TBA-2020 Bug Fix Request
This code is not perfect !

It just to give an idea of what a unique stack of coins could be.
In fact, instead of a double extract_obj, and create_money. There should probably be
an update_room_coins function.

Also, if you cast 'invisibility' on the stack on ground, after that if you kill a mobile. Once the corpse decay. The money will sums up and become visible.

This is just a quick 11 lines example.

Bob
Code:
void obj_to_room(struct obj_data *object, room_rnum room) { + struct obj_data *obj_room, *coins; if (!object || room == NOWHERE || room > top_of_world) log("SYSERR: Illegal value(s) passed to obj_to_room. (Room #%d/%d, obj %p)", room, top_of_world, (void *)object); else { + if (GET_OBJ_TYPE(object) == ITEM_MONEY) { + for (obj_room = world[room].contents; obj_room; obj_room = obj_room->next_content) + if (GET_OBJ_TYPE(obj_room) == ITEM_MONEY) { + coins = create_money(GET_OBJ_COST(obj_room) + GET_OBJ_COST(object)); + extract_obj(obj_room); + extract_obj(object); + object = coins; + break; + } + } object->next_content = world[room].contents; world[room].contents = object; IN_ROOM(object) = room; object->carried_by = NULL; if (ROOM_FLAGGED(room, ROOM_HOUSE)) SET_BIT_AR(ROOM_FLAGS(room), ROOM_HOUSE_CRASH); }

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

More
02 Mar 2020 23:05 #8606 by thomas
Replied by thomas on topic TBA-2020 Bug Fix Request

Sapphire wrote: I read through the github post you made, but I'm not sure where I should begin. Is this a definitive fix? It appears to be in a patch format at first, but then there are alternate solutions offered. Which would you say is the best path to a crash free mud?

Oh, you might want to follow the links to the pull request: github.com/tbamud/tbamud/pull/84/files?u...%93&diff=unified&w=1

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

More
05 Mar 2020 12:24 #8608 by JTP
Replied by JTP on topic TBA-2020 Bug Fix Request
Does the pull Update work ?

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

More
05 Mar 2020 16:53 #8609 by Sapphire
Replied by Sapphire on topic TBA-2020 Bug Fix Request
I just want to thank the TBA staff and the community members which saw the OP and looked into the issue. The response from everyone was overwhelmingly quick and positive, such an awesome MUD coding community. Thanks everyone!

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

More
05 Mar 2020 18:47 #8610 by thomas
Replied by thomas on topic TBA-2020 Bug Fix Request

JTP wrote: Does the pull Update work ?

Yes, but I'm not entirely satisfied with it.

I think it will need a little more tweaking (for instance, at least one of the functions should be inline) before it can be merged.

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

More
05 Mar 2020 18:55 #8612 by thomas
Replied by thomas on topic TBA-2020 Bug Fix Request
I've made a new issue based on the discussion about coin stacks: github.com/tbamud/tbamud/issues/86

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

Time to create page: 0.231 seconds