Slightly better to just declare the string inline right here, like:
const std::string monID = g->zombie(i).type->id;