summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/ClientHandle.cpp2
-rw-r--r--source/Entities/ProjectileEntity.cpp13
-rw-r--r--source/Mobs/AggressiveMonster.cpp2
-rw-r--r--source/Mobs/Horse.cpp5
-rw-r--r--source/Mobs/Pig.cpp4
5 files changed, 21 insertions, 5 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index c67e829d2..ea8b48f9d 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -650,7 +650,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc
m_LastDigBlockZ = a_BlockZ;
if (
- (m_Player->GetGameMode() == eGameMode_Creative) || // In creative mode, digging is done immediately
+ (m_Player->IsGameModeCreative()) || // In creative mode, digging is done immediately
g_BlockOneHitDig[a_OldBlock] // One-hit blocks get destroyed immediately, too
)
{
diff --git a/source/Entities/ProjectileEntity.cpp b/source/Entities/ProjectileEntity.cpp
index 4c8e680d0..1d5532718 100644
--- a/source/Entities/ProjectileEntity.cpp
+++ b/source/Entities/ProjectileEntity.cpp
@@ -474,8 +474,17 @@ cThrownEggEntity::cThrownEggEntity(cEntity * a_Creator, double a_X, double a_Y,
void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
{
- // TODO: Random-spawn a chicken or four
-
+ if (m_World->GetTickRandomNumber(7) == 1)
+ {
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ }
+ else if (m_World->GetTickRandomNumber(32) == 1)
+ {
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ }
Destroy();
}
diff --git a/source/Mobs/AggressiveMonster.cpp b/source/Mobs/AggressiveMonster.cpp
index ee6252656..88bd2743a 100644
--- a/source/Mobs/AggressiveMonster.cpp
+++ b/source/Mobs/AggressiveMonster.cpp
@@ -33,7 +33,7 @@ void cAggressiveMonster::InStateChasing(float a_Dt)
if (m_Target->IsPlayer())
{
cPlayer * Player = (cPlayer *) m_Target;
- if (Player->GetGameMode() == 1)
+ if (Player->IsGameModeCreative())
{
m_EMState = IDLE;
return;
diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp
index f9705a451..d18887ea4 100644
--- a/source/Mobs/Horse.cpp
+++ b/source/Mobs/Horse.cpp
@@ -1,4 +1,3 @@
-
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Horse.h"
@@ -142,6 +141,10 @@ void cHorse::OnRightClicked(cPlayer & a_Player)
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
AddRandomDropItem(a_Drops, 0, 2, E_ITEM_LEATHER);
+ if (m_bIsSaddled)
+ {
+ a_Drops.push_back(cItem(E_ITEM_SADDLE, 1));
+ }
}
diff --git a/source/Mobs/Pig.cpp b/source/Mobs/Pig.cpp
index 5427cf35f..0871a38a9 100644
--- a/source/Mobs/Pig.cpp
+++ b/source/Mobs/Pig.cpp
@@ -22,6 +22,10 @@ cPig::cPig(void) :
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
AddRandomDropItem(a_Drops, 1, 3, IsOnFire() ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP);
+ if (m_bIsSaddled)
+ {
+ a_Drops.push_back(cItem(E_ITEM_SADDLE, 1));
+ }
}