#include "stinc.h"
#include "stgame.h"
#include "stgamedm.h"

gzGameDM::gzGameDM()
{
	this->RegisterEvent(EVT_OBJECT_DAMAGE);
}
void gzGameDM::Object_Damaged(gzEventObjectDamage &evt)
{
	if (evt.m_defender)
	{
		if (evt.m_defender->As_BuildingGameObj() || evt.m_defender->As_VehicleGameObj())
			evt.Skip();
		if (evt.m_defender->As_SoldierGameObj())
		{
			// Invincible spawn
			if ((GetTickCount() - SystemTime - evt.m_defender->CreationTime) / 1000 <= gzGameMgr->GetSettings()->m_InvincibleSecs)
				evt.Skip();
		}
	}
}
