diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Entities/Entity.cpp | 10 | ||||
-rw-r--r-- | src/Mobs/Monster.cpp | 5 | ||||
-rw-r--r-- | src/World.cpp | 5 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 86aee4c6f..56ef36ef8 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -771,6 +771,16 @@ void cEntity::TickBurning(cChunk & a_Chunk) { // Remember the current burning state: bool HasBeenBurning = (m_TicksLeftBurning > 0); + + if (GetWorld()->GetWeather() == eWeather_Rain) + { + if (HasBeenBurning) + { + m_TicksLeftBurning = 0; + OnFinishedBurning(); + } + return; + } // Do the burning damage: if (m_TicksLeftBurning > 0) diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index d63758b3d..9df5d5e3b 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -540,7 +540,7 @@ void cMonster::KilledBy(cEntity * a_Killer) break; } } - if (a_Killer != NULL) + if ((a_Killer != NULL) && (!IsBaby()) { m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward); } @@ -1003,7 +1003,8 @@ void cMonster::HandleDaylightBurning(cChunk & a_Chunk) (a_Chunk.GetSkyLight(RelX, RelY, RelZ) == 15) && // In the daylight (a_Chunk.GetBlock(RelX, RelY, RelZ) != E_BLOCK_SOULSAND) && // Not on soulsand (GetWorld()->GetTimeOfDay() < (12000 + 1000)) && // It is nighttime - !IsOnFire() // Not already burning + !IsOnFire() && // Not already burning + (GetWorld()->GetWeather() != eWeather_Rain) // Not raining ) { // Burn for 100 ticks, then decide again diff --git a/src/World.cpp b/src/World.cpp index c23e255f8..800bdde0e 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1691,6 +1691,11 @@ int cWorld::SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE BlockType, NI int cWorld::SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward) { + if (a_Reward < 1) + { + return -1; + } + cExpOrb * ExpOrb = new cExpOrb(a_X, a_Y, a_Z, a_Reward); ExpOrb->Initialize(this); return ExpOrb->GetUniqueID(); |