Tidy pack.go split: drop unused lp param and named returns
This commit is contained in:
@@ -98,7 +98,7 @@ func (g *RogueGame) packInsert(obj *Object, fromFloor bool) (*Object, bool) {
|
||||
if op := p.Pack[i]; op.Kind == obj.Kind && op.Which == obj.Which {
|
||||
var ok bool
|
||||
|
||||
obj, lp, merged, ok = g.packMatch(obj, op, i, lp, fromFloor)
|
||||
obj, lp, merged, ok = g.packMatch(obj, op, i, fromFloor)
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
@@ -156,7 +156,7 @@ func packScanWhich(pack []*Object, obj *Object, i, lp int) (int, int) {
|
||||
// anything else marks the insertion point (the matched-subtype switch
|
||||
// of pack.c add_pack). It returns the resulting entry, the insert-after
|
||||
// index, whether a merge happened, and ok false when the pack is full.
|
||||
func (g *RogueGame) packMatch(obj, op *Object, i, lp int, fromFloor bool) (*Object, int, bool, bool) {
|
||||
func (g *RogueGame) packMatch(obj, op *Object, i int, fromFloor bool) (*Object, int, bool, bool) {
|
||||
switch {
|
||||
case op.Kind.MergesInPack():
|
||||
if !g.packRoom(fromFloor, obj) {
|
||||
@@ -393,8 +393,9 @@ func (g *RogueGame) pickyInven() {
|
||||
}
|
||||
|
||||
// promptPackItem picks something out of a pack for a purpose (pack.c
|
||||
// get_item); ok reports whether the player chose an item.
|
||||
func (g *RogueGame) promptPackItem(purpose string, kind ObjectKind) (obj *Object, ok bool) {
|
||||
// get_item); the second result reports whether the player chose an
|
||||
// item.
|
||||
func (g *RogueGame) promptPackItem(purpose string, kind ObjectKind) (*Object, bool) {
|
||||
p := &g.Player
|
||||
if len(p.Pack) == 0 {
|
||||
g.msg("you aren't carrying anything")
|
||||
|
||||
Reference in New Issue
Block a user