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

Method HasItemId

internal/scripting/actor_func.go:557–571  ·  view source on GitHub ↗
(itemId int, excludeWorn ...bool)

Source from the content-addressed store, hash-verified

555}
556
557func (a ScriptActor) HasItemId(itemId int, excludeWorn ...bool) bool {
558 for _, itm := range a.characterRecord.GetAllBackpackItems() {
559 if itm.ItemId == itemId {
560 return true
561 }
562 }
563 if len(excludeWorn) == 0 || !excludeWorn[0] {
564 for _, itm := range a.characterRecord.GetAllWornItems() {
565 if itm.ItemId == itemId {
566 return true
567 }
568 }
569 }
570 return false
571}
572
573func (a ScriptActor) GetBackpackItems() []ScriptItem {
574 itms := make([]ScriptItem, 0, 5)

Callers 10

onEnterFunction · 0.80
onCommandFunction · 0.80
onEnterFunction · 0.80
onCommandFunction · 0.80
onCommandFunction · 0.80
onCommandFunction · 0.80
onCommandFunction · 0.80
onEnterFunction · 0.80
onCommandFunction · 0.80
onEnterFunction · 0.80

Calls 2

GetAllBackpackItemsMethod · 0.80
GetAllWornItemsMethod · 0.80

Tested by

no test coverage detected