Exp Orbs and Pickups are destroyed instantly by cacti. (#4136)
* Cactus detection code follows pattern set in #3996 * Pickups are now destroyed on cactus contact * Add cactus detection and destruction to Exp Orbs Remove checks for IsExpOrb() in cEntity::Tick() Exp Orbs do not call super::Tick() and so this condition was pointless.
This commit is contained in:
committed by
GitHub
parent
3065a101a5
commit
07619d932d
@@ -46,6 +46,8 @@ void cExpOrb::SpawnOn(cClientHandle & a_Client)
|
||||
|
||||
void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
DetectCacti();
|
||||
|
||||
// Check player proximity no more than twice per second
|
||||
if ((m_TicksAlive % 10) == 0)
|
||||
{
|
||||
@@ -79,3 +81,14 @@ void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
Destroy(true);
|
||||
}
|
||||
}
|
||||
|
||||
bool cExpOrb::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (a_TDI.DamageType == dtCactusContact)
|
||||
{
|
||||
Destroy(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user