Preserve original string when activitating entites.

This commit is contained in:
Steve 2018-02-03 16:31:12 +00:00
parent 52b4336c00
commit 72de423bba
1 changed files with 8 additions and 2 deletions

View File

@ -771,17 +771,23 @@ static int isObserving(void)
return 0; return 0;
} }
void activateEntities(char *names, int active) void activateEntities(char *nameList, int active)
{ {
Entity *oldSelf; Entity *oldSelf;
char *name; char *name, names[MAX_DESCRIPTION_LENGTH];
STRNCPY(names, nameList, MAX_DESCRIPTION_LENGTH);
oldSelf = self; oldSelf = self;
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "Activating '%s'", names);
name = strtok(names, "|"); name = strtok(names, "|");
while (name) while (name)
{ {
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "Activate '%s'", name);
for (self = world.entityHead.next ; self != NULL ; self = self->next) for (self = world.entityHead.next ; self != NULL ; self = self->next)
{ {
if (strcmp(self->name, name) == 0) if (strcmp(self->name, name) == 0)