aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2022-02-17 15:44:31 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2022-02-17 15:44:31 +0700
commit2c44d2e60bb83d333b7d80c935f9578b4f11522a (patch)
treec0ffa1fbdfbfd3eb095046b5c9da7e76eef80ce6 /src
parent18e53fb4b9d77a457c6a9aebc38c5dd0f1519689 (diff)
downloadblackshades-2c44d2e60bb83d333b7d80c935f9578b4f11522a.tar.gz
Make laser always and only availble in 3rd person
This breaks configuration backward compatibility.
Diffstat (limited to 'src')
-rw-r--r--src/Game.h1
-rw-r--r--src/GameLoop.cpp2
-rw-r--r--src/GameTick.cpp7
-rw-r--r--src/config.h2
-rw-r--r--src/config.zig3
5 files changed, 4 insertions, 11 deletions
diff --git a/src/Game.h b/src/Game.h
index 3ab46f8..e3fd80c 100644
--- a/src/Game.h
+++ b/src/Game.h
@@ -93,7 +93,6 @@ struct Game {
int civkills;
int machinegunsoundloop;
- bool lasersight;
bool debug;
bool paused;
diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp
index f174e70..0cfe3ef 100644
--- a/src/GameLoop.cpp
+++ b/src/GameLoop.cpp
@@ -59,8 +59,6 @@ void handleKey(Game* game, int key, int action, int mods)
alSourcef(gSourceID[mainmenusong], AL_MIN_GAIN, 0);
alSourcePlay(gSourceID[game->whichsong]);
alSourcef(gSourceID[game->whichsong], AL_MIN_GAIN, 1);
- } else if (key == keymap.laser_sight) {
- game->lasersight ^= 1;
} else if (key == keymap.dive) {
if (player.playerrotation == player.playerlowrotation
&& player.targetanimation == joganim
diff --git a/src/GameTick.cpp b/src/GameTick.cpp
index f72a1c4..3c44bdb 100644
--- a/src/GameTick.cpp
+++ b/src/GameTick.cpp
@@ -780,10 +780,9 @@ void renderLaser(Game* game)
break;
case handgun1:
case handgun2:
- coeff = thirdperson ? 0.35f : 0.65f;
aim = DoRotation(joints[righthand].position
- - joints[head].position * coeff
- - joints[neck].position * (1.0 - coeff),
+ - joints[head].position * 0.35f
+ - joints[neck].position * 0.65f,
0.0f, player.playerrotation - 0.9f, 0.0f);
coeff = -0.15f;
break;
@@ -2174,7 +2173,7 @@ void Game::Tick()
}
}
- if (lasersight && !zoom)
+ if (thirdperson && !zoom)
renderLaser(this);
//Snow
diff --git a/src/config.h b/src/config.h
index c43f1a0..b314277 100644
--- a/src/config.h
+++ b/src/config.h
@@ -17,7 +17,7 @@ struct Level {
struct Key {
int forwards, backwards, left, right;
int crouch, accelerate, dive;
- int reload, aim, psychic_aim, psychic, laser_sight;
+ int reload, aim, psychic_aim, psychic;
int switch_view, switch_weapon;
int skip, pause, slomo, force;
};
diff --git a/src/config.zig b/src/config.zig
index d561244..0d18223 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -134,7 +134,6 @@ pub const Config = extern struct {
aim: Key = .E,
psychic_aim: Key = .Q,
psychic: Key = .Z,
- laser_sight: Key = .L,
switch_view: Key = .TAB,
switch_weapon: Key = .X,
@@ -207,8 +206,6 @@ pub fn parse(base_dir: []const u8) !Config {
config.key.psychic_aim = stringToEnum(Key, kv.value).?
else if (eql(u8, kv.key, "psychic key"))
config.key.psychic = stringToEnum(Key, kv.value).?
- else if (eql(u8, kv.key, "laser sight key"))
- config.key.laser_sight = stringToEnum(Key, kv.value).?
else if (eql(u8, kv.key, "switch view key"))
config.key.switch_view = stringToEnum(Key, kv.value).?
else if (eql(u8, kv.key, "switch weapon key"))