/
lookup_dir()
lookup_dir()
Additional Info Needed
This page is incomplete.
Information on Function
New function added by Nimrod (7 Sept 13)
Returns direction integer after checking through constant variables dirs and short_dirs based on value passed, such as north, northwest, nw, se, etc...
Call Example
Function Code
int lookup_dir(char *value) { unsigned int i; for (i = 0; i <= LAST_DIR; i++) { if (!strncmp (dirs[i], value, strlen (value))) return i; //return &dirs[i]; } // did not find in dirs, now look in short_dirs for (i = 0; i <= LAST_DIR; i++) { if (!strncmp (short_dirs[i], value, strlen (value))) return i; //return &dirs[i]; } // did not find at all return -1; }
Copyright 2015 Shadows of Isildur