This commit is contained in:
zaoqi 2017-08-28 22:04:38 +08:00
parent 52aae1a590
commit 1c077c819b
2 changed files with 3 additions and 7 deletions

View File

@ -141,14 +141,13 @@ public:
void updateCameraOffset(const v3s16 &camera_offset)
{ m_camera_offset = camera_offset; }
v3s16 getCameraOffset() const { return m_camera_offset; }
UNORDERED_MAP<u16, ClientActiveObject*> m_active_objects;
ClientActiveObjectMap m_active_objects;
private:
ClientMap *m_map;
LocalPlayer *m_local_player = nullptr;
ITextureSource *m_texturesource;
Client *m_client;
ClientScripting *m_script = nullptr;
ClientActiveObjectMap m_active_objects;
std::vector<ClientSimpleObject*> m_simple_objects;
std::queue<ClientEnvEvent> m_client_event_queue;
IntervalLimiter m_active_object_light_update_interval;

View File

@ -443,13 +443,10 @@ int ModApiClient::l_punch_all(lua_State *L)
PointedThing pointed;
pointed.type = POINTEDTHING_OBJECT;
UNORDERED_MAP<u16, ClientActiveObject*> m_active_objects = client->getEnv().m_active_objects;
u16 my_peer_id = client->getEnv().getLocalPlayer()->peer_id;
for (UNORDERED_MAP<u16, ClientActiveObject*>::iterator i = m_active_objects.begin();
i != m_active_objects.end(); ++i) {
ClientActiveObject* obj = i->second;
for (auto &ao_it : client->getEnv().m_active_objects) {
ClientActiveObject* obj = ao_it.second;
u16 peer_id = obj->getId();
if(peer_id != my_peer_id) {
pointed.object_id = peer_id;