1
This commit is contained in:
parent
e4bd8249c2
commit
16c743f12d
@ -313,3 +313,11 @@ bool BoxDrop::GetNextBoxPos(glm::vec3& pos)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BoxDrop::DropByUuid(int obj_uniid, const glm::vec3& center)
|
||||||
|
{
|
||||||
|
int box_num = GetAndDecObjBoxNum(obj_uniid);
|
||||||
|
if (box_num > 0) {
|
||||||
|
Drop(box_num, center);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -16,6 +16,7 @@ class BoxDrop : public std::enable_shared_from_this<BoxDrop>
|
|||||||
void OnObstacleDeadDrop(Obstacle* ob);
|
void OnObstacleDeadDrop(Obstacle* ob);
|
||||||
void RequestReturnBoxNum();
|
void RequestReturnBoxNum();
|
||||||
bool GetNextBoxPos(glm::vec3& pos);
|
bool GetNextBoxPos(glm::vec3& pos);
|
||||||
|
void DropByUuid(int obj_uniid, const glm::vec3& center);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -318,6 +318,9 @@ bool Obstacle::DoInteraction(Human* sender)
|
|||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
#if 1
|
#if 1
|
||||||
sender->DropItems(center, drops);
|
sender->DropItems(center, drops);
|
||||||
|
if (!empty(drops)) {
|
||||||
|
sender->room->GetBoxDrop()->DropByUuid(obj_uniid, center);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
Entity* entity = sender->room->GetEntityByUniId(obj_uniid);
|
Entity* entity = sender->room->GetEntityByUniId(obj_uniid);
|
||||||
if (entity && entity->IsEntityType(ET_Obstacle)) {
|
if (entity && entity->IsEntityType(ET_Obstacle)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user