Client *m_client;
};
-class FormspecFormSource: public IFormSource
-{
-public:
- FormspecFormSource(std::string formspec,FormspecFormSource** game_formspec)
- {
- m_formspec = formspec;
- m_game_formspec = game_formspec;
- }
-
- ~FormspecFormSource()
- {
- *m_game_formspec = 0;
- }
-
- void setForm(std::string formspec) {
- m_formspec = formspec;
- }
-
- std::string getForm()
- {
- return m_formspec;
- }
-
- std::string m_formspec;
- FormspecFormSource** m_game_formspec;
-};
-
/*
Check if a node is pointable
*/
u32 daynight_ratio = m_client->getEnv().getDayNightRatio();
float daynight_ratio_f = (float)daynight_ratio / 1000.0;
services->setPixelShaderConstant("dayNightRatio", &daynight_ratio_f, 1);
+
+ // Normal map texture layer
+ int layer = 1;
+ services->setPixelShaderConstant("normalTexture" , (irr::f32*)&layer, 1);
}
};
camera.step(dtime);
v3f player_position = player->getPosition();
+ v3s16 pos_i = floatToInt(player_position, BS);
v3f camera_position = camera.getPosition();
v3f camera_direction = camera.getDirection();
f32 camera_fov = camera.getFovMax();
//u32 t1 = device->getTimer()->getRealTime();
- f32 d = 4; // max. distance
+ f32 d = playeritem_def.range; // max. distance
+ f32 d_hand = itemdef->get("").range;
+ if(d < 0 && d_hand >= 0)
+ d = d_hand;
+ else if(d < 0)
+ d = 4.0;
core::line3d<f32> shootline(camera_position,
camera_position + camera_direction * BS * (d+1));
if(tp)
params = getDigParams(nodedef->get(n).groups, tp);
}
-
- SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
- if(sound_dig.exists()){
- if(sound_dig.name == "__group"){
- if(params.main_group != ""){
- soundmaker.m_player_leftpunch_sound.gain = 0.5;
- soundmaker.m_player_leftpunch_sound.name =
- std::string("default_dig_") +
- params.main_group;
- }
- } else{
- soundmaker.m_player_leftpunch_sound = sound_dig;
- }
- }
float dig_time_complete = 0.0;
dig_index = crack_animation_length;
}
+ SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
+ if(sound_dig.exists() && params.diggable){
+ if(sound_dig.name == "__group"){
+ if(params.main_group != ""){
+ soundmaker.m_player_leftpunch_sound.gain = 0.5;
+ soundmaker.m_player_leftpunch_sound.name =
+ std::string("default_dig_") +
+ params.main_group;
+ }
+ } else{
+ soundmaker.m_player_leftpunch_sound = sound_dig;
+ }
+ }
+
// Don't show cracks if not diggable
if(dig_time_complete >= 100000.0)
{
<<", "<<(player_position.Y/BS)
<<", "<<(player_position.Z/BS)
<<") (yaw="<<(wrapDegrees_0_360(camera_yaw))
- <<") (seed = "<<((unsigned long long)client.getMapSeed())
+ <<") (t="<<client.getEnv().getClientMap().getHeat(pos_i)
+ <<"C, h="<<client.getEnv().getClientMap().getHumidity(pos_i)
+ <<"%) (seed = "<<((unsigned long long)client.getMapSeed())
<<")";
guitext2->setText(narrow_to_wide(os.str()).c_str());
guitext2->setVisible(true);