aboutsummaryrefslogtreecommitdiff
path: root/entities
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-13 21:56:01 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-13 21:56:01 -0400
commit14514c06cf8101b949dcc37499acbb50b8aebb25 (patch)
tree476213189e969d5b8afd7bc98a0b5847eb56f721 /entities
parentaceb05f916ec50f3dfe0aeae148e17d8a01fe2fc (diff)
downloadwintersurvival2-14514c06cf8101b949dcc37499acbb50b8aebb25.tar.gz
wintersurvival2-14514c06cf8101b949dcc37499acbb50b8aebb25.tar.bz2
wintersurvival2-14514c06cf8101b949dcc37499acbb50b8aebb25.zip
Finally fixed the problem with research tables occasionally returning bad recipie
Diffstat (limited to 'entities')
-rw-r--r--entities/entities/ws_researchtable/init.lua29
1 files changed, 10 insertions, 19 deletions
diff --git a/entities/entities/ws_researchtable/init.lua b/entities/entities/ws_researchtable/init.lua
index d9e3045..3fc4233 100644
--- a/entities/entities/ws_researchtable/init.lua
+++ b/entities/entities/ws_researchtable/init.lua
@@ -5,24 +5,15 @@ include('shared.lua')
--[[An item to give hints to players that are just starting out]]
local PossibleRecipies = {
- [2] = { [0]="Barrel",
- [1]="Planks and Sap"},
- [3] = { [0]="Fence",
- [1]="Planks and Sap"},
- [4] = { [0]="Knife",
- [1]="Rock, Sap, Wood, and Crystal"},
- [5] = { [0]="Log",
- [1]="Vine, Sap, and Wood"},
- [6] = { [0]="Plank",
- [1]="Wood and Sap"},
- [7] = { [0]="Rope",
- [1]="Vine and Sap"},
- [8] = { [0]="Sickle",
- [1]="Wood, Rock, and Sap"},
- [9] = { [0]="Stoneblock",
- [1]="Rock and Sap"},
- [11] = { [0]="Vine",
- [1]="Hitting an Antlion hill with a Sickle"},
+ {"Barrel","Planks and Sap"},
+ {"Fence","Planks and Sap"},
+ {"Knife","Rock, Sap, Wood, and Crystal"},
+ {"Log","Vine, Sap, and Wood"},
+ {"Plank","Wood and Sap"},
+ {"Rope","Vine and Sap"},
+ {"Sickle","Wood, Rock, and Sap"},
+ {"Stoneblock","Rock and Sap"},
+ {"Vine","Hitting an Antlion hill with a Sickle"},
}
function ENT:Initialize()
@@ -43,7 +34,7 @@ end
function ENT:Think()
- local randomrecipie = PossibleRecipies[math.random(1,10)]
+ local randomrecipie = PossibleRecipies[math.random(1,#PossibleRecipies)]
if(randomrecipie == nil) then
print("Random recipie returned null in reasearchtable:init.lua line 47")
return