Client *m_client;
};
+struct TextDestPlayerInventory : public TextDest
+{
+ TextDestPlayerInventory(Client *client)
+ {
+ m_client = client;
+ }
+ void gotText(std::map<std::string, std::string> fields)
+ {
+ m_client->sendInventoryFields("", fields);
+ }
+
+ Client *m_client;
+};
+
/* Respawn menu callback */
class MainRespawnInitiator: public IRespawnInitiator
float object_hit_delay_timer = 0.0;
float time_from_last_punch = 10;
+ float update_draw_list_timer = 0.0;
+ v3f update_draw_list_last_cam_dir;
+
bool invert_mouse = g_settings->getBool("invert_mouse");
bool respawn_menu_active = false;
assert(src);
menu->setFormSpec(src->getForm(), inventoryloc);
menu->setFormSource(src);
+ menu->setTextDest(new TextDestPlayerInventory(&client));
menu->drop();
}
else if(input->wasKeyDown(EscapeKey))
<<playeritem.name<<" is "
<<def.node_placement_prediction<<std::endl;
v3s16 p = neighbourpos;
+ // Place inside node itself if buildable_to
+ try{
+ MapNode n_under = map.getNode(nodepos);
+ if(nodedef->get(n_under).buildable_to)
+ p = nodepos;
+ }catch(InvalidPositionException &e){}
+ // Find id of predicted node
content_t id;
bool found =
nodedef->getId(def.node_placement_prediction, id);
item = mlist->getItem(client.getPlayerItem());
camera.wield(item);
}
-
+
+ /*
+ Update block draw list every 200ms or when camera direction has
+ changed much
+ */
+ update_draw_list_timer += dtime;
+ if(update_draw_list_timer >= 0.2 ||
+ update_draw_list_last_cam_dir.getDistanceFrom(camera_direction) > 0.2){
+ update_draw_list_timer = 0;
+ client.getEnv().getClientMap().updateDrawList(driver);
+ update_draw_list_last_cam_dir = camera_direction;
+ }
+
/*
Drawing begins
*/