Added a few API accessors to cArrowEntity.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "Globals.h"
|
||||
#include "ProjectileEntity.h"
|
||||
#include "../ClientHandle.h"
|
||||
#include "Player.h"
|
||||
|
||||
|
||||
|
||||
@@ -98,6 +99,22 @@ cArrowEntity::cArrowEntity(cEntity * a_Creator, double a_X, double a_Y, double a
|
||||
|
||||
|
||||
|
||||
bool cArrowEntity::CanPickup(const cPlayer & a_Player) const
|
||||
{
|
||||
switch (m_PickupState)
|
||||
{
|
||||
case psNoPickup: return false;
|
||||
case psInSurvivalOrCreative: return (a_Player.IsGameModeSurvival() || a_Player.IsGameModeCreative());
|
||||
case psInCreative: return a_Player.IsGameModeCreative();
|
||||
}
|
||||
ASSERT(!"Unhandled pickup state");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cArrowEntity::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendSpawnObject(*this, pkArrow, 0, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user