Add durable recipe discovery and profession crafting
This commit is contained in:
@@ -47,6 +47,13 @@ func (w *World) AdminItems(c *Character, op, value string) error {
|
||||
known = true
|
||||
}
|
||||
}
|
||||
if w.Balance.Crafting != nil {
|
||||
for _, m := range w.Balance.Crafting.Materials {
|
||||
if m.ID == id {
|
||||
known = true
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, definition := range w.Balance.Items {
|
||||
if definition.ID == id {
|
||||
known = true
|
||||
@@ -79,7 +86,7 @@ func (w *World) AdminItems(c *Character, op, value string) error {
|
||||
if c.View.Inventory[id] < n {
|
||||
return errors.New("player no longer holds that item quantity")
|
||||
}
|
||||
c.View.Inventory[id] -= n
|
||||
TakeStack(c, id, n)
|
||||
if c.View.Inventory[id] == 0 {
|
||||
delete(c.View.Inventory, id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user