472 {
473 int checksum, count;
474 if (!ctx.
Read(checksum))
475 {
476 return false;
477 }
478
479 if (!ctx.
Read(count))
480 {
481 return false;
482 }
483 for (int i = 0; i < count; ++i)
484 {
485 int value, agents, temperature;
486 if (!ctx.
Read(value))
487 return false;
488
489 if (!ctx.
Read(agents))
490 return false;
491
492 if (version >= 140 && !ctx.
Read(temperature))
493 return false;
494
496 {
501 int food_stage = value & food_mask;
502
503
504
505
507 AddToStomach(classname, amount, food_stage, agents, temperature);
508 }
509 }
510
512 {
513 Print(
"Stomach checksum fail");
514 }
515 return true;
516 }
void AddToStomach(string class_name, float amount, int food_stage=0, int agents=0, float temperature=0)
const int quantity_bit_offset
static string GetClassnameFromID(int id)
proto bool Read(void value_in)
proto void Print(void var)
Prints content of variable to console/log.
static proto float Pow(float v, float power)
Return power of v ^ power.