Remove useless import,add exception catch

This commit is contained in:
yangzhi 2019-10-10 09:40:43 +08:00
parent c2c6dec531
commit cc5b550cef
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,5 @@
#include "main.h" #include "main.h"
#include "cwmods/cwmods.h" #include "cwmods/cwmods.h"
#include "cwmods/common/LongVector3.h"
#include <wchar.h> #include <wchar.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -59,8 +58,12 @@ void InitHomeMap(){
std::string x = elements.at(1); std::string x = elements.at(1);
std::string y = elements.at(2); std::string y = elements.at(2);
std::string z = elements.at(3); std::string z = elements.at(3);
std::vector<long long> coords {std::stoll(x), std::stoll(y), std::stoll(z)}; try {
home_map[name] = coords; std::vector<long long> coords {std::stoll(x), std::stoll(y), std::stoll(z)};
home_map[name] = coords;
} catch ( ... ) {
continue;
}
} }
} }
} }
@ -393,4 +396,4 @@ EXPORT HandleP2PRequest(long long steamID) {
EXPORT void ModInitialize() { EXPORT void ModInitialize() {
InitHomeMap(); InitHomeMap();
} }