MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiProcessShipChecksum

Function MultiProcessShipChecksum

Descent3/multi_connect.cpp:693–718  ·  view source on GitHub ↗

Returns a unique value for this ship

Source from the content-addressed store, hash-verified

691
692// Returns a unique value for this ship
693void MultiProcessShipChecksum(MD5 *md5, int ship_index) {
694 ship *s = &Ships[ship_index];
695
696 md5->update(s->phys_info.full_thrust);
697 md5->update(s->phys_info.full_rotthrust);
698
699 md5->update(s->phys_info.mass);
700 md5->update(s->phys_info.drag);
701 md5->update(s->phys_info.rotdrag);
702
703 md5->update(s->phys_info.flags);
704 poly_model *pm = GetPolymodelPointer(s->model_handle);
705 md5->update(pm->rad);
706
707 for (int w = 0; w < MAX_PLAYER_WEAPONS; w++) {
708
709 for (int i = 0; i < MAX_WB_FIRING_MASKS; i++) {
710 md5->update(s->static_wb[w].gp_fire_wait[i]);
711 md5->update(s->static_wb[w].gp_fire_masks[i]);
712 }
713
714 md5->update(s->static_wb[w].energy_usage);
715 md5->update(s->static_wb[w].ammo_usage);
716 md5->update(s->fire_flags[w]);
717 }
718}
719
720// Server is telling us about the level
721void MultiDoLevelInfo(uint8_t *data) {

Callers 2

MultiDoDoneObjectsFunction · 0.85
MultiSendDoneObjectsFunction · 0.85

Calls 2

GetPolymodelPointerFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected