1
This commit is contained in:
parent
7ed5aa8fa7
commit
d3e74e59dd
@ -399,6 +399,15 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
[room = room, items] (int event, const a8::Args* args)
|
[room = room, items] (int event, const a8::Args* args)
|
||||||
{
|
{
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
for (int obj_uniid : items) {
|
||||||
|
Entity* e = room->GetEntityByUniId(obj_uniid);
|
||||||
|
if (e && e->IsLoot()) {
|
||||||
|
Loot* l = e->AsLoot();
|
||||||
|
if (!l->pickuped && !l->removing) {
|
||||||
|
room->RemoveObjectLater(l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
&room->xtimer_attacher_);
|
&room->xtimer_attacher_);
|
||||||
|
@ -1405,7 +1405,7 @@ int HeroAgent::SearchPickupObj()
|
|||||||
|
|
||||||
bool HeroAgent::PickupObjIsValid()
|
bool HeroAgent::PickupObjIsValid()
|
||||||
{
|
{
|
||||||
if (curr_pickup_obj_.Get() && owner_->IsHuman()) {
|
if (curr_pickup_obj_.Get() && !curr_pickup_obj_.Get()->removing && owner_->IsHuman()) {
|
||||||
if (curr_pickup_obj_.Get()->IsLoot()) {
|
if (curr_pickup_obj_.Get()->IsLoot()) {
|
||||||
Loot* loot = curr_pickup_obj_.Get()->AsLoot();
|
Loot* loot = curr_pickup_obj_.Get()->AsLoot();
|
||||||
return !loot->pickuped;
|
return !loot->pickuped;
|
||||||
|
@ -700,7 +700,7 @@ void Player::ProcInteraction()
|
|||||||
#ifdef MYDEBUG1
|
#ifdef MYDEBUG1
|
||||||
a8::XPrintf("LootInteraction %d\n", {obj_id});
|
a8::XPrintf("LootInteraction %d\n", {obj_id});
|
||||||
#endif
|
#endif
|
||||||
if (entity) {
|
if (entity && !entity->removing) {
|
||||||
if (entity->GetPos().Distance2D2(GetPos()) > 600) {
|
if (entity->GetPos().Distance2D2(GetPos()) > 600) {
|
||||||
#ifdef MYDEBUG1
|
#ifdef MYDEBUG1
|
||||||
a8::XPrintf("LootInteraction error3 %d\n", {entity->GetUniId()});
|
a8::XPrintf("LootInteraction error3 %d\n", {entity->GetUniId()});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user