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

Method GetWornItem

internal/scripting/actor_func.go:946–953  ·  view source on GitHub ↗
(slot string)

Source from the content-addressed store, hash-verified

944}
945
946func (a ScriptActor) GetWornItem(slot string) *ScriptItem {
947 itm := a.characterRecord.Equipment.Get(items.ItemType(slot))
948 if itm == nil || itm.ItemId <= 0 || itm.IsDisabled() {
949 return nil
950 }
951 si := newScriptItem(*itm)
952 return &si
953}
954
955func (a ScriptActor) FindInBackpack(itemName string) *ScriptItem {
956 itm, found := a.characterRecord.FindInBackpack(itemName)

Callers

nothing calls this directly

Calls 4

ItemTypeTypeAlias · 0.92
newScriptItemFunction · 0.85
GetMethod · 0.45
IsDisabledMethod · 0.45

Tested by

no test coverage detected