Fixed network error, leaving try block in place for the time being
It seems that the union type Packet didn't initialize Packet::type to PacketType::NONE using in class initialization. I've fixed this by moving the initialization of Packet::type to Packet::Packet(). This might actually be a compiler error, I might need to let someone know.
This commit is contained in:
@@ -13,10 +13,10 @@ static std::deque<Packet> queue;
|
||||
|
||||
int networkQueue(void*) {
|
||||
UDPNetworkUtility* netUtil = ServiceLocator<UDPNetworkUtility>::Get();
|
||||
Packet p;
|
||||
for(;;) {
|
||||
SDL_SemWait(lock);
|
||||
while(netUtil->Receive()) {
|
||||
Packet p;
|
||||
memcpy(&p, netUtil->GetInData(), sizeof(Packet));
|
||||
queue.push_back(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user