From 39263718846f0cc45f6ffe32a7366e74e7ed7eab Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 14 Mar 2018 07:06:40 +0100 Subject: proto/ft: set game name to unknown if no entry --- proto-ft/ftnoir_protocol_ft.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'proto-ft') diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 0c97ffd2..593fdaa9 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -105,7 +105,7 @@ void freetrack::pose(const double* headpose) if (intGameID != id) { QString gamename; - union { + union { unsigned char table[8]; std::int32_t ints[2]; } t; @@ -114,6 +114,9 @@ void freetrack::pose(const double* headpose) (void)CSV::getGameData(id, t.table, gamename); + if (gamename.isEmpty()) + gamename = _("Unknown game"); + static_assert(sizeof(LONG) == 4, ""); static_assert(sizeof(int) == 4, ""); -- cgit v1.2.3