TempusMUD/Tempuscode
1
0
Fork
You've already forked Tempuscode
0

Fix mass purging of rooms and zones #509

Merged
origintempus merged 1 commit from fix-entire-room-or-zone-purging into master 2015年11月28日 19:48:41 +01:00
origintempus commented 2015年11月28日 19:47:42 +01:00 (Migrated from github.com)
Copy link

This fixes the issue with purging entire rooms or zones. When you use the purge command without arguments, or zpurge, every mob and object in a room, or zone, is supposed to get purged. However, right now it only destroys the first mob in the room, or each room in zpurge.

This is due to a problem with GList and removing an item from the list while iterating through the list at the same time. This is why only the first mob actually gets purged. After the first removal from the list the iteration fails. This fix changes the way the iteration through the room list of mobiles is processed, allowing the next item in the list to be saved before removing the current item.

This fix changes the loop both in do_purge() and in do_zonepurge() to actually go through the entire list of room occupants and purge them.

It should be noted that as this actually makes purging entire rooms work again, when zpurging there will be slight lag with zones that have a large number of occupants.

This fixes the issue with purging entire rooms or zones. When you use the purge command without arguments, or zpurge, every mob and object in a room, or zone, is supposed to get purged. However, right now it only destroys the first mob in the room, or each room in zpurge. This is due to a problem with GList and removing an item from the list while iterating through the list at the same time. This is why only the first mob actually gets purged. After the first removal from the list the iteration fails. This fix changes the way the iteration through the room list of mobiles is processed, allowing the next item in the list to be saved before removing the current item. This fix changes the loop both in do_purge() and in do_zonepurge() to actually go through the entire list of room occupants and purge them. It should be noted that as this actually makes purging entire rooms work again, when zpurging there will be slight lag with zones that have a large number of occupants.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TempusMUD/Tempuscode!509
Reference in a new issue
TempusMUD/Tempuscode
No description provided.
Delete branch "fix-entire-room-or-zone-purging"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?