Skip to content

Commit

Permalink
fix again some crashes wit jprofiler
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin452 committed Mar 25, 2024
1 parent 9d828db commit db3de69
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/client/huds/drawhud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@ end
local seuilVersLeHaut = Mathpi / 4
local seuilVersLeBas = -Mathpi / 4
function GetPlayerDirection(rotation, pitch)
_JPROFILER.push("GetPlayerDirection")
if pitch then
if pitch > seuilVersLeHaut then
_JPROFILER.pop("GetPlayerDirection")
return "Bas"
elseif pitch < seuilVersLeBas then
_JPROFILER.pop("GetPlayerDirection")
return "Haut"
end
end
Expand All @@ -70,7 +67,6 @@ function GetPlayerDirection(rotation, pitch)
local index = math.floor(((rotation + Mathpi / 8) % (2 * Mathpi)) / (Mathpi / 4)) + 1
return directions[index]
end
_JPROFILER.pop("GetPlayerDirection")
return nil
end

Expand Down
8 changes: 0 additions & 8 deletions src/entities/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,11 @@ function ChooseSpawnLocation()
else
currentTry = currentTry + 1
if currentTry % 100 == 0 then
LuaCraftLoggingFunc(
LuaCraftLoggingLevel.NORMAL,
"Still trying to find a suitable spawn position... Try #" .. currentTry
)
end
end
end

if not foundSolidBlock then
LuaCraftLoggingFunc(
LuaCraftLoggingLevel.ERROR,
"Unable to find a suitable spawn position after " .. maxTries .. " tries."
)
_JPROFILER.pop("ChooseSpawnLocation")
return
end
Expand Down
4 changes: 3 additions & 1 deletion src/utils/gamestateshandling/GameStatePlayingGame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ function GameStatePlayingGame2:textinput(text)
end
end
function GameStatePlayingGame2:update(dt)
_JPROFILER.push("GameStatePlayingGame2:update")
renderdistancevalue()
PlayerInitIfNeeded()
UpdateAndGenerateChunks(RenderDistance)
--UpdateAndGenerateChunks(RenderDistance)
UpdateLogic(dt)
_JPROFILER.pop("GameStatePlayingGame2:update")
end

function GameStatePlayingGame2:draw()
Expand Down
2 changes: 1 addition & 1 deletion src/world/gen/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function GenerateTerrain(chunk, x, z, generationFunction)
local zz = (z - 1) * ChunkSize + k
chunk.heightMap[i][k] = 0
local sunlight = true
GenerateChunk(chunk, xx, zz, sunlight, i, k, generationFunction)
--GenerateChunk(chunk, xx, zz, sunlight, i, k, generationFunction)
end
end
temp = {}
Expand Down

0 comments on commit db3de69

Please sign in to comment.