// signage.txt - Modified specobj script, used with signs in towns. If the
//     terrain is searched, a flag is set. A state may be run, but it
//     normally won't be.

// Memory Cells - 
//   0 - Not currently being used.
//   1,2 - Coordinates for a stuff done flag. If these are 0 and 0, 
//     ignored. Otherwise, is the given flag is less than the value in
//     cell 3, the flag is set to that after being searched.
//   3 - The value to set the flag to.

beginterrainscript; 

variables;

body;

beginstate INIT_STATE;

	break;

beginstate START_STATE;
break;

beginstate SEARCH_STATE;
	if((get_memory_cell(1) == 0) && (get_memory_cell(2) == 0))
		end();

	if((get_flag(get_memory_cell(1),get_memory_cell(2))) < (get_memory_cell(3)))
		set_flag(get_memory_cell(1), get_memory_cell(2), get_memory_cell(3));

break;
