mirror of
				https://github.com/DarkflameUniverse/DarkflameServer.git
				synced 2025-11-03 22:21:59 +00:00 
			
		
		
		
	fix: dying while dead (#1905)
This commit is contained in:
		@@ -694,6 +694,8 @@ void DestroyableComponent::NotifySubscribers(Entity* attacker, uint32_t damage)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType, const std::u16string& deathType, uint32_t skillID) {
 | 
			
		||||
	if (m_IsDead) return;
 | 
			
		||||
 | 
			
		||||
	//check if hardcore mode is enabled
 | 
			
		||||
	if (Game::entityManager->GetHardcoreMode()) {
 | 
			
		||||
		DoHardcoreModeDrops(source);
 | 
			
		||||
@@ -706,6 +708,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
 | 
			
		||||
		Game::entityManager->SerializeEntity(m_Parent);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	m_IsDead = true;
 | 
			
		||||
	m_KillerID = source;
 | 
			
		||||
 | 
			
		||||
	auto* owner = Game::entityManager->GetEntity(source);
 | 
			
		||||
 
 | 
			
		||||
@@ -471,6 +471,8 @@ public:
 | 
			
		||||
	bool OnGetObjectReportInfo(GameMessages::GameMsg& msg);
 | 
			
		||||
	bool OnSetFaction(GameMessages::GameMsg& msg);
 | 
			
		||||
 | 
			
		||||
	void SetIsDead(const bool value) { m_IsDead = value; }
 | 
			
		||||
 | 
			
		||||
	static Implementation<bool, const Entity*> IsEnemyImplentation;
 | 
			
		||||
	static Implementation<bool, const Entity*> IsFriendImplentation;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -978,6 +978,7 @@ void GameMessages::SendResurrect(Entity* entity) {
 | 
			
		||||
		auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
 | 
			
		||||
 | 
			
		||||
		if (destroyableComponent != nullptr && entity->GetLOT() == 1) {
 | 
			
		||||
			destroyableComponent->SetIsDead(false);
 | 
			
		||||
			auto* levelComponent = entity->GetComponent<LevelProgressionComponent>();
 | 
			
		||||
			if (levelComponent) {
 | 
			
		||||
				int32_t healthToRestore = levelComponent->GetLevel() >= 45 ? 8 : 4;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user