dig = <SimpleSoundSpec>, -- "__group" = group-based sound (default)
dug = <SimpleSoundSpec>,
place = <SimpleSoundSpec>,
+ place_failed = <SimpleSoundSpec>,
},
drop = "", -- Name of dropped node when dug. Default is the node itself.
-- Alternatively:
SimpleSoundSpec();
if (playeritem_def.node_placement_prediction == "" ||
- nodedef_manager->get(map.getNodeNoEx(nodepos)).rightclickable)
+ nodedef_manager->get(map.getNodeNoEx(nodepos)).rightclickable) {
client->interact(3, pointed); // Report to server
+ } else {
+ soundmaker->m_player_rightpunch_sound =
+ playeritem_def.sound_place_failed;
+ }
}
}
}
groups = def.groups;
node_placement_prediction = def.node_placement_prediction;
sound_place = def.sound_place;
+ sound_place_failed = def.sound_place_failed;
range = def.range;
return *this;
}
}
groups.clear();
sound_place = SimpleSoundSpec();
+ sound_place_failed = SimpleSoundSpec();
range = -1;
node_placement_prediction = "";
os<<serializeString(sound_place.name);
writeF1000(os, sound_place.gain);
}
- if(protocol_version > 20){
+ if (protocol_version > 20) {
writeF1000(os, range);
+ os << serializeString(sound_place_failed.name);
+ writeF1000(os, sound_place_failed.gain);
}
}
}
// If you add anything here, insert it primarily inside the try-catch
// block to not need to increase the version.
- try{
- }catch(SerializationError &e) {};
+ try {
+ sound_place_failed.name = deSerializeString(is);
+ sound_place_failed.gain = readF1000(is);
+ } catch(SerializationError &e) {};
}
/*
ToolCapabilities *tool_capabilities;
ItemGroupList groups;
SimpleSoundSpec sound_place;
+ SimpleSoundSpec sound_place_failed;
f32 range;
// Client shall immediately place this node when player places the item.
lua_getfield(L, -1, "place");
read_soundspec(L, -1, def.sound_place);
lua_pop(L, 1);
+ lua_getfield(L, -1, "place_failed");
+ read_soundspec(L, -1, def.sound_place_failed);
+ lua_pop(L, 1);
}
lua_pop(L, 1);