diff options
author | changyong guo <guo1487@163.com> | 2018-07-23 11:24:00 +0200 |
---|---|---|
committer | peterbell10 <peterbell10@live.co.uk> | 2018-07-23 11:24:00 +0200 |
commit | 01e72ddb6567531b16f92af2564b853878b6ef65 (patch) | |
tree | b91403cec84e0b405448d8fadbc2c39f2270ab47 /src/Entities/Player.cpp | |
parent | Keep players in gmNotSet (#4248) (diff) | |
download | cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.tar cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.tar.gz cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.tar.bz2 cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.tar.lz cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.tar.xz cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.tar.zst cuberite-01e72ddb6567531b16f92af2564b853878b6ef65.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index d8bb22e2f..181a54870 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -3069,3 +3069,31 @@ float cPlayer::GetPlayerRelativeBlockHardness(BLOCKTYPE a_Block) // LOGD("blockHardness: %f, digSpeed: %f, canHarvestBlockDivisor: %f\n", blockHardness, digSpeed, canHarvestBlockDivisor); return (blockHardness < 0) ? 0 : ((digSpeed / blockHardness) / canHarvestBlockDivisor); } + + + + + + +float cPlayer::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower) +{ + if ( + IsGameModeSpectator() || + (IsGameModeCreative() && !IsOnGround()) + ) + { + return 0; // No impact from explosion + } + + return super::GetExplosionExposureRate(a_ExplosionPosition, a_ExlosionPower); +} + + + + + + + + + + |