修复救人bug

This commit is contained in:
aozhiwei 2024-08-15 14:26:43 +08:00
parent 1e7b83be9a
commit 96c1ae8039
2 changed files with 44 additions and 2 deletions

View File

@ -3,6 +3,8 @@
#include <math.h>
#include <float.h>
#include <a8/magicenum.h>
#include "buff.h"
#include "human.h"
#include "room.h"
@ -49,10 +51,50 @@ void Buff::Init()
res_scale = meta->GetResScale(this);
res_scale_frameno = owner->room->GetFrameNo();
}
#ifdef MYDEBUG
switch (meta->buff_effect()) {
case kBET_InRescue:
case kBET_Rescuer:
{
a8::XPrintf("add jiuyuan role_name:%s type:%s buff_id:%d buff_effect:%\n",
{
owner->GetName(),
owner->IsPlayer() ? "player" : "android",
meta->buff_id(),
a8::GetEnumName<BuffEffectType_e>(meta->buff_effect())
});
}
break;
default:
{
}
break;
}
#endif
}
void Buff::UnInit()
{
#ifdef MYDEBUG
switch (meta->buff_effect()) {
case kBET_InRescue:
case kBET_Rescuer:
{
a8::XPrintf("remove jiuyuan role_name:%s type:%s buff_id:%d buff_effect:%\n",
{
owner->GetName(),
owner->IsPlayer() ? "player" : "android",
meta->buff_id(),
a8::GetEnumName<BuffEffectType_e>(meta->buff_effect())
});
}
break;
default:
{
}
break;
}
#endif
list_del_init(&effect_entry);
if (!list_empty(&depend_entry)) {
list_del_init(&depend_entry);

View File

@ -894,7 +894,7 @@ void Human::UpdateAction()
break;
case AT_Rescue:
{
RemoveBuffByEffectId(kBET_InRescue);
RemoveBuffByEffectId(kBET_Rescuer);
}
break;
default:
@ -1807,7 +1807,7 @@ void Human::ProcUseItemAction()
void Human::ProcReliveAction()
{
RemoveBuffByEffectId(kBET_Rescuer);
RemoveBuffByEffectId(kBET_InRescue);
Entity* entity = room->GetEntityByUniId(action_target_id);
if (!entity->IsEntityType(ET_Player)) {
return;