37 #include "../entity/entity.h"
39 #include "..\entity\entity.h"
83 while (loop < loop_end)
90 while (loop_episodic < loop_episodic_end)
109 if(returnFile->
data == 0L)
119 while (loop < local_sim->num)
121 fileout_being(returnFile, local_sim, loop, (
noble_file_entry *)noble_file_format);
135 n_uint episodic_count = 0;
142 if (temp_store == 0L)
144 return SHOW_ERROR(
"No temporary storage memory available");
151 ret_val =
io_read_buff(input_file, temp_store, noble_file_format);
154 return SHOW_ERROR(
"Signature not first in file");
163 return SHOW_ERROR(
"File newer than Simulation");
169 ret_val =
io_read_buff(input_file, temp_store, noble_file_format);
188 temp = (
n_byte*)(&local_social[social_count]);
195 temp = (
n_byte*)(&local_episodic[episodic_count]);
207 io_copy(temp_store, temp, loop_end);
212 if (ape_count == local_sim->
max)
214 local_sim->
num = ape_count;
215 return SHOW_ERROR(
"Too many apes for memory");
221 if (social_count == (local_sim->
max * SOCIAL_SIZE))
223 local_sim->
num = ape_count;
224 return SHOW_ERROR(
"Too many social graph events for memory");
230 if (episodic_count == (local_sim->
max * EPISODIC_SIZE))
232 local_sim->
num = ape_count;
233 return SHOW_ERROR(
"Too many episodic events for memory");
244 local_sim->
num = ape_count;
259 if( temp_select < 0 )
264 n_uint local_select = temp_select;
265 if( local_select >= local_sim->
num)
269 local_being = &(local_sim->
beings[local_select]);
281 if((value < 0) || (value > 255))
286 if( (current_x < 0) || (current_y < 0) || (current_z < 0) ||
287 (current_x > 31) || (current_y > 31) || (current_z > 31))
294 if (local_brain != 0L)
416 n_byte first_value = kind[0];
417 n_byte second_value = kind[1];
441 n_int local_number = 0;
448 local_number = local_vector.x;
452 local_number = local_vector.y;
486 if( (quick_x < 0) || (quick_y < 0) ||
520 local_number = local_sim->
land->
time;
523 local_number = local_sim->
land->
date;
529 local_number = local_sim->
num;
543 if( (quick_x < 0) || (quick_y < 0) ||
559 if( (current_x < 0) || (current_y < 0) || (current_z < 0) ||
560 (current_x > 31) || (current_y > 31) || (current_z > 31))
567 if (local_brain != 0L)
569 local_number =
TRACK_BRAIN(local_brain, current_x, current_y, current_z);
586 if( temp_select < 0 )
591 n_uint local_select = temp_select;
592 if( local_select >= local_sim->
num)
596 local_being = &(local_sim->
beings[local_select]);
597 if (local_being != 0L)
600 if (local_social_graph!=0L)
606 if (local_episodic != 0L)
621 else if ((local_being != 0L) && (local_social_graph != 0L))
627 local_number = local_being->
honor;
633 local_number =
GET_H(local_being);
647 local_number = local_being->
goal[0];
650 local_number = local_being->
goal[1];
653 local_number = local_being->
goal[2];
681 local_number =
GET_I(local_being);
825 local_number = episodic.
event;
838 *number = local_number;
898 local_facing = 255 - ( (0 - local_facing) & 255 );
902 local_facing = local_facing & 255;
905 if (local_speed > 39) local_speed = 39;
906 if (local_speed < 0) local_speed = 0;
923 if (local_drive_hunger>-1)
927 if (local_drive_social>-1)
931 if (local_drive_fatigue>-1)
935 if (local_drive_sex>-1)
945 #define FILE_CHECK(value) io_offset((n_byte*)&here, (n_byte*)value, #value)