Add lots of memory safety to client interface

This commit is contained in:
Lion Kortlepel
2020-11-08 02:50:17 +01:00
parent 96668add6e
commit 26383d5346
8 changed files with 38 additions and 29 deletions

View File

@@ -125,9 +125,9 @@ void SyncClient(Client*c){
Respond(c,Sec("Sn")+c->GetName(),true);
SendToAll(c,Sec("JWelcome ")+c->GetName()+"!",false,true);
TriggerLuaEvent(Sec("onPlayerJoin"),false,nullptr,std::unique_ptr<LuaArg>(new LuaArg{{c->GetID()}}),false);
for (Client*client : CI->Clients) {
for (auto& client : CI->Clients) {
if(client != nullptr){
if (client != c) {
if (client.get() != c) {
for (VData *v : client->GetAllCars()) {
if(v != nullptr){
Respond(c, v->Data, true);