Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 3138d25c6b176205c9a8215aa5bf90486c29d852 1 parent 045473d
@clanehin authored
View
2  roguestar-engine/src/Protocol.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
View
2  roguestar-engine/src/Tool.hs
@@ -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 ()
Please sign in to comment.
Something went wrong with that request. Please try again.