Chat prefix empty message fix / Call.sound volume limit increase
This commit is contained in:
@@ -164,14 +164,14 @@ public class NetClient implements ApplicationListener{
|
||||
public static void sound(Sound sound, float volume, float pitch, float pan){
|
||||
if(sound == null) return;
|
||||
|
||||
sound.play(Mathf.clamp(volume, 0, 2f) * Core.settings.getInt("sfxvol") / 100f, pitch, pan);
|
||||
sound.play(Mathf.clamp(volume, 0, 4f) * Core.settings.getInt("sfxvol") / 100f, pitch, pan);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both, unreliable = true)
|
||||
public static void soundAt(Sound sound, float x, float y, float volume, float pitch){
|
||||
if(sound == null) return;
|
||||
|
||||
sound.at(x, y, pitch, Mathf.clamp(volume, 0, 2f));
|
||||
sound.at(x, y, pitch, Mathf.clamp(volume, 0, 4f));
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both, unreliable = true)
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Damage{
|
||||
public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, @Nullable Team ignoreTeam, Effect explosionFx){
|
||||
if(damage){
|
||||
for(int i = 0; i < Mathf.clamp(power / 700, 0, 8); i++){
|
||||
int length = 5 + Mathf.clamp((int)(power / 500), 1, 20);
|
||||
int length = 5 + Mathf.clamp((int)(Mathf.pow(power, 0.98f) / 500), 1, 18);
|
||||
Time.run(i * 0.8f + Mathf.random(4f), () -> Lightning.create(Team.derelict, Pal.power, 3 + Mathf.pow(power, 0.35f), x, y, Mathf.random(360f), length + Mathf.range(2)));
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,8 @@ public class ChatFragment extends Table{
|
||||
String message = chatfield.getText().trim();
|
||||
clearChatInput();
|
||||
|
||||
if(message.isEmpty()) return;
|
||||
//avoid sending prefix-empty messages
|
||||
if(message.isEmpty() || (message.startsWith(mode.prefix) && message.substring(mode.prefix.length()).isEmpty())) return;
|
||||
|
||||
history.insert(1, message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user