Fix incorrect example code in equipment tutorial
The code to replace equipment in a single-item slot references a variable that is never used before or after, and incorrectly sets it to the item that is doing the replacement instead of the item being replaced, which causes the replaced item to not be moved back into the backpack.
This commit is contained in:
parent
ac06ff735c
commit
54e5e63b8d
1 changed files with 2 additions and 2 deletions
|
|
@ -402,7 +402,7 @@ class EquipmentHandler:
|
||||||
to_backpack = [obj]
|
to_backpack = [obj]
|
||||||
else:
|
else:
|
||||||
# for others (body, head), just replace whatever's there
|
# for others (body, head), just replace whatever's there
|
||||||
replaced = [obj]
|
to_backpack = [slots[use_slot]]
|
||||||
slots[use_slot] = obj
|
slots[use_slot] = obj
|
||||||
|
|
||||||
for to_backpack_obj in to_backpack:
|
for to_backpack_obj in to_backpack:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue