From 54e5e63b8d6f0966b2ca3349d6ad5ca2df3dfe01 Mon Sep 17 00:00:00 2001 From: feyrkh Date: Sun, 29 Sep 2024 12:25:15 -0500 Subject: [PATCH] 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. --- .../Beginner-Tutorial/Part3/Beginner-Tutorial-Equipment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Equipment.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Equipment.md index cb81de616c..51df4e3bc2 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Equipment.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Equipment.md @@ -402,7 +402,7 @@ class EquipmentHandler: to_backpack = [obj] else: # for others (body, head), just replace whatever's there - replaced = [obj] + to_backpack = [slots[use_slot]] slots[use_slot] = obj for to_backpack_obj in to_backpack: @@ -612,4 +612,4 @@ _Handlers_ are useful for grouping functionality together. Now that we spent our We also learned to use _hooks_ to tie _Knave_'s custom equipment handling into Evennia. -With `Characters`, `Objects` and now `Equipment` in place, we should be able to move on to character generation - where players get to make their own character! \ No newline at end of file +With `Characters`, `Objects` and now `Equipment` in place, we should be able to move on to character generation - where players get to make their own character!