MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / mobTrashCommand

Method mobTrashCommand

modules/cleanup/cleanup.go:128–145  ·  view source on GitHub ↗
(rest string, mob *mobs.Mob, room *rooms.Room)

Source from the content-addressed store, hash-verified

126}
127
128func (c *CleanupModule) mobTrashCommand(rest string, mob *mobs.Mob, room *rooms.Room) (bool, error) {
129
130 // Check whether the user has an item in their inventory that matches
131 matchItem, found := mob.Character.FindInBackpack(rest)
132
133 if found {
134 mob.Character.RemoveItem(matchItem)
135
136 events.AddToQueue(events.ItemOwnership{
137 MobInstanceId: mob.InstanceId,
138 Item: matchItem,
139 Gained: false,
140 })
141
142 }
143
144 return true, nil
145}
146
147func (c *CleanupModule) userBuryCommand(rest string, user *users.UserRecord, room *rooms.Room, flags events.EventFlag) (bool, error) {
148

Callers

nothing calls this directly

Calls 3

AddToQueueFunction · 0.92
FindInBackpackMethod · 0.45
RemoveItemMethod · 0.45

Tested by

no test coverage detected