From ad049a15b43b7ddba3fe7d0a898652fc8022629d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 22 Apr 2014 11:46:23 -0700 Subject: Use strict ID types Possibly some missing for the far side of the network. AccountId and BlockId are still terribly entangled. --- src/mmo/extract.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/mmo/extract.cpp') diff --git a/src/mmo/extract.cpp b/src/mmo/extract.cpp index 378986d..f25126f 100644 --- a/src/mmo/extract.cpp +++ b/src/mmo/extract.cpp @@ -22,6 +22,8 @@ #include "../strings/xstring.hpp" #include "../strings/vstring.hpp" +#include "mmo.hpp" + #include "../poison.hpp" bool extract(XString str, XString *rv) @@ -47,7 +49,7 @@ bool extract(XString str, struct item *it) XString ignored; return extract(str, record<',', 11>( - &it->id, + &ignored, &it->nameid, &it->amount, &it->equip, @@ -60,3 +62,24 @@ bool extract(XString str, struct item *it) &ignored, &ignored)); } + +bool extract(XString str, MapName *m) +{ + XString::iterator it = std::find(str.begin(), str.end(), '.'); + str = str.xislice_h(it); + VString<15> tmp; + bool rv = extract(str, &tmp); + *m = tmp; + return rv; +} + +bool extract(XString str, CharName *out) +{ + VString<23> tmp; + if (extract(str, &tmp)) + { + *out = CharName(tmp); + return true; + } + return false; +} -- cgit v1.2.3-70-g09d2