Salur 1 Posted June 21, 2016 Share Posted June 21, 2016 I want to do command removing all discarded objects. How can I check the source all the objects lying on the ground and remove them? ACMD (do_clean_earth) { [......] ch->ChatPacket (CHAT_TYPE_INFO, "Cleaning all object with earth."); } Link to comment Share on other sites More sharing options...
.Devil. 28 Posted June 23, 2016 Share Posted June 23, 2016 struct FuncPurgeOnGround { void operator () (LPENTITY ent) { if (!ent->IsType(ENTITY_ITEM)) return; M2_DESTROY_ITEM((LPITEM) ent); } }; ACMD(do_purge_on_ground) { FuncPurgeOnGround func; LPSECTREE sectree = ch->GetSectree(); // only current map if (sectree) sectree->ForEachAround(func); else sys_err("PURGE_ERROR.NULL_SECTREE(mapIndex=%d, pos=(%d, %d)", ch->GetMapIndex(), ch->GetX(), ch->GetY()); } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now