Permalink
Browse files

Fix bug where the first inventory item would always appear as wielded.

  • Loading branch information...
1 parent 045473d commit 3138d25c6b176205c9a8215aa5bf90486c29d852 @clanehin committed Apr 1, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 roguestar-engine/src/Protocol.hs
  2. +1 −1 roguestar-engine/src/Tool.hs
@@ -448,7 +448,7 @@ dbDispatchQuery ["wielded-objects","0"] =
wieldedPairToTable creature_ref = fmap (\tool_ref -> (B.pack $ show $ toUID tool_ref) `B.append` " " `B.append` (B.pack $ show $ toUID creature_ref))
return $ "begin-table wielded-objects 0 uid creature\n" `B.append`
B.unlines (catMaybes $ zipWith wieldedPairToTable creature_refs wielded_tool_refs) `B.append`
- "end-table"
+ "end-table"
dbDispatchQuery ["biome"] =
do m_plane_ref <- dbGetCurrentPlane
@@ -70,7 +70,7 @@ availableWields creature_ref =
return $ List.union carried_tools pickups
getWielded :: (DBReadable db) => CreatureRef -> db (Maybe ToolRef)
-getWielded = liftM (listToMaybe . map (asChild . identityDetail) . mapLocations) . getContents
+getWielded = liftM (listToMaybe . map (asChild . detail) . filterLocations (\(Wielded {}) -> True)) . getContents
-- | Safely delete tools.
deleteTool :: ToolRef -> DB ()

0 comments on commit 3138d25

Please sign in to comment.