Skip to content

Commit

Permalink
plugins: fix compilation with C++ < 11
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebeatrici committed Aug 30, 2018
1 parent 2dcfe63 commit 65576fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions plugins/borderlands2/borderlands2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,18 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (state == 0)
return true; // This results in all vectors beeing zero which tells Mumble to ignore them.

struct
{
float front[3];
float top[3];
float position[3];
} game_vects;

ok = peekProc(vects_ptr, avatar_front, 12) &&
peekProc(vects_ptr + 12, avatar_top, 12) &&
peekProc(vects_ptr + 24, avatar_pos, 12);

ok = peekProc(vects_ptr, game_vects);
if (!ok) return false;

// Copy game vectors into return values
for (int i=0;i<3;i++)
{
camera_pos[i] = avatar_pos[i] = game_vects.position[i] / 100.0f; // Scale to meters
camera_front[i] = avatar_front[i] = game_vects.front[i];
camera_top[i] = avatar_top[i] = game_vects.top[i];
camera_pos[i] = avatar_pos[i] /= 100.0f; // Scale to meters
camera_front[i] = avatar_front[i];
camera_top[i] = avatar_top[i];
}


Expand Down
2 changes: 1 addition & 1 deletion plugins/mumble_plugin_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static inline int checkProcessIs64Bit(const pid_t pid)
ss << "/exe";

std::ifstream ifs;
ifs.open(ss.str(), std::ifstream::binary);
ifs.open(ss.str().c_str(), std::ifstream::binary);
if (!ifs.is_open()) {
return -1;
}
Expand Down

0 comments on commit 65576fc

Please sign in to comment.