Corentin Cailleaud commited on
Commit ·
f7f82c2
1
Parent(s): 4e101e0
cubzh.lua
CHANGED
|
@@ -721,23 +721,26 @@ Client.OnWorldObjectLoad = function(obj)
|
|
| 721 |
if obj.Name == "pirate_ship" then
|
| 722 |
obj.Scale = 1
|
| 723 |
end
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
local pos = obj.Position:Copy()
|
| 738 |
-
gigaxWorldConfig.
|
| 739 |
-
gigaxWorldConfig.NPCs[
|
| 740 |
-
|
|
|
|
|
|
|
|
|
|
| 741 |
obj:RemoveFromParent()
|
| 742 |
end
|
| 743 |
end
|
|
@@ -780,7 +783,7 @@ Client.OnStart = function()
|
|
| 780 |
pathfinding:createPathfindingMap()
|
| 781 |
|
| 782 |
gigax:setConfig(gigaxWorldConfig)
|
| 783 |
-
|
| 784 |
local randomNames = { "aduermael", "soliton", "gdevillele", "caillef", "voxels", "petroglyph" }
|
| 785 |
Player.Avatar:load({ usernameOrId = randomNames[math.random(#randomNames)] })
|
| 786 |
end
|
|
|
|
| 721 |
if obj.Name == "pirate_ship" then
|
| 722 |
obj.Scale = 1
|
| 723 |
end
|
| 724 |
+
|
| 725 |
+
local locationsIndexByName = {}
|
| 726 |
+
for k, v in ipairs(gigaxWorldConfig.locations) do
|
| 727 |
+
locationsIndexByName[v.name] = k
|
| 728 |
+
end
|
| 729 |
+
local npcIndexByName = {
|
| 730 |
+
NPC_scientist = 1,
|
| 731 |
+
NPC_baker = 2,
|
| 732 |
+
NPC_pirate = 3,
|
| 733 |
+
}
|
| 734 |
+
|
| 735 |
+
local index = npcIndexByName[obj.Name]
|
| 736 |
+
if index then
|
| 737 |
local pos = obj.Position:Copy()
|
| 738 |
+
gigaxWorldConfig.NPCs[index].position = pos
|
| 739 |
+
gigaxWorldConfig.NPCs[index].rotation = obj.Rotation:Copy()
|
| 740 |
+
|
| 741 |
+
local locationName = gigaxWorldConfig.NPCs[index].currentLocationName
|
| 742 |
+
local locationIndex = locationsIndexByName[locationName]
|
| 743 |
+
gigaxWorldConfig.locations[locationIndex].position = pos
|
| 744 |
obj:RemoveFromParent()
|
| 745 |
end
|
| 746 |
end
|
|
|
|
| 783 |
pathfinding:createPathfindingMap()
|
| 784 |
|
| 785 |
gigax:setConfig(gigaxWorldConfig)
|
| 786 |
+
|
| 787 |
local randomNames = { "aduermael", "soliton", "gdevillele", "caillef", "voxels", "petroglyph" }
|
| 788 |
Player.Avatar:load({ usernameOrId = randomNames[math.random(#randomNames)] })
|
| 789 |
end
|