diff options
author | x12xx12x <44411062+12xx12@users.noreply.github.com> | 2021-11-26 00:51:47 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2022-01-14 20:43:29 +0100 |
commit | 250b8eb652a57dcbdff4af7b6efb9c2554b45798 (patch) | |
tree | 1d8bf1aaeac6974d75c83524c8000161d8cc104c /src/Physics/Explodinator.cpp | |
parent | Fix WriteXZYPosition64 and add tests (diff) | |
download | cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.gz cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.bz2 cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.lz cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.xz cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.zst cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.zip |
Diffstat (limited to 'src/Physics/Explodinator.cpp')
-rw-r--r-- | src/Physics/Explodinator.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Physics/Explodinator.cpp b/src/Physics/Explodinator.cpp index 72d050c59..7cd266c15 100644 --- a/src/Physics/Explodinator.cpp +++ b/src/Physics/Explodinator.cpp @@ -390,9 +390,9 @@ namespace Explodinator // Trace rays from the explosion centre to all points in a square of area TraceCubeSideLength * TraceCubeSideLength // for the top and bottom sides: - for (int OffsetX = -HalfSide; OffsetX < HalfSide; OffsetX++) + for (float OffsetX = -HalfSide; OffsetX < HalfSide; OffsetX++) { - for (int OffsetZ = -HalfSide; OffsetZ < HalfSide; OffsetZ++) + for (float OffsetZ = -HalfSide; OffsetZ < HalfSide; OffsetZ++) { DestructionTrace(&a_Chunk, a_Position, Vector3f(OffsetX, +HalfSide, OffsetZ), a_Power, a_Fiery, RandomIntensity(Random, a_Power), a_ExplodingEntity); DestructionTrace(&a_Chunk, a_Position, Vector3f(OffsetX, -HalfSide, OffsetZ), a_Power, a_Fiery, RandomIntensity(Random, a_Power), a_ExplodingEntity); @@ -400,9 +400,9 @@ namespace Explodinator } // Left and right sides, avoid duplicates at top and bottom edges: - for (int OffsetX = -HalfSide; OffsetX < HalfSide; OffsetX++) + for (float OffsetX = -HalfSide; OffsetX < HalfSide; OffsetX++) { - for (int OffsetY = -HalfSide + 1; OffsetY < HalfSide - 1; OffsetY++) + for (float OffsetY = -HalfSide + 1; OffsetY < HalfSide - 1; OffsetY++) { DestructionTrace(&a_Chunk, a_Position, Vector3f(OffsetX, OffsetY, +HalfSide), a_Power, a_Fiery, RandomIntensity(Random, a_Power), a_ExplodingEntity); DestructionTrace(&a_Chunk, a_Position, Vector3f(OffsetX, OffsetY, -HalfSide), a_Power, a_Fiery, RandomIntensity(Random, a_Power), a_ExplodingEntity); @@ -410,9 +410,9 @@ namespace Explodinator } // Front and back sides, avoid all edges: - for (int OffsetZ = -HalfSide + 1; OffsetZ < HalfSide - 1; OffsetZ++) + for (float OffsetZ = -HalfSide + 1; OffsetZ < HalfSide - 1; OffsetZ++) { - for (int OffsetY = -HalfSide + 1; OffsetY < HalfSide - 1; OffsetY++) + for (float OffsetY = -HalfSide + 1; OffsetY < HalfSide - 1; OffsetY++) { DestructionTrace(&a_Chunk, a_Position, Vector3f(+HalfSide, OffsetY, OffsetZ), a_Power, a_Fiery, RandomIntensity(Random, a_Power), a_ExplodingEntity); DestructionTrace(&a_Chunk, a_Position, Vector3f(-HalfSide, OffsetY, OffsetZ), a_Power, a_Fiery, RandomIntensity(Random, a_Power), a_ExplodingEntity); @@ -425,7 +425,7 @@ namespace Explodinator { for (const auto Client : a_Chunk.GetAllClients()) { - Client->SendExplosion(a_Position, a_Power); + Client->SendExplosion(a_Position, static_cast<float>(a_Power)); } } |