Skip to content

Commit

Permalink
disable q, 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
parameterized committed Mar 2, 2019
1 parent 780c083 commit 902d260
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Open World RPG

*Current version: 0.2.0*<br>
*Current version: 0.3.0*<br>
*Uses Love2D version 11.2.0*

![](https://i.imgur.com/rF9idF9.png)
Expand Down
34 changes: 18 additions & 16 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,24 @@ function love.keypressed(k, scancode, isrepeat)
hud.keypressed(k, scancode, isrepeat)
playerController.keypressed(k, scancode, isrepeat)
portals.client.keypressed(k, scancode, isrepeat)
if k == 'q' then
local p = playerController.player
for _, costItemId in ipairs(quests.current.cost) do
local costItem = items.client.getItem(costItemId)
if costItem then
-- duplicates costItem
for invSlotId, _ in ipairs(hud.inventorySlots) do
local slotType = slot2type[invSlotId]
if p.inventory.items[invSlotId] == nil
and (slotType == nil or slotType == costItem.type) then
client.setInventorySlot{
slotId = invSlotId,
itemId = costItemId
}
p.inventory.items[invSlotId] = costItemId
break
if false then
if k == 'q' then
local p = playerController.player
for _, costItemId in ipairs(quests.current.cost) do
local costItem = items.client.getItem(costItemId)
if costItem then
-- duplicates costItem
for invSlotId, _ in ipairs(hud.inventorySlots) do
local slotType = slot2type[invSlotId]
if p.inventory.items[invSlotId] == nil
and (slotType == nil or slotType == costItem.type) then
client.setInventorySlot{
slotId = invSlotId,
itemId = costItemId
}
p.inventory.items[invSlotId] = costItemId
break
end
end
end
end
Expand Down

0 comments on commit 902d260

Please sign in to comment.