MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zEntPickup_Load

Function zEntPickup_Load

src/SB/Game/zEntPickup.cpp:1130–1189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130void zEntPickup_Load(zEntPickup* ent, xSerial* s)
1131{
1132 S32 is_a_dropper = 0;
1133
1134 zEntLoad(ent, s);
1135
1136 if (ent->state & 0x10)
1137 {
1138 is_a_dropper = 1;
1139 }
1140
1141 U32 state = 0;
1142 S32 coll = 0;
1143
1144 s->Read_b7(&state);
1145 s->Read_b1(&coll);
1146
1147 if (state & 0x4)
1148 {
1149 ent->state = (ent->state & ~0x3f) | 0x8;
1150
1151 xEntHide(ent);
1152 }
1153
1154 ent->state = state;
1155
1156 if (coll)
1157 {
1158 ent->pickupFlags |= 0x2;
1159 }
1160 else
1161 {
1162 ent->pickupFlags &= (U8)~0x2;
1163 }
1164
1165 if (ent->pickupFlags & 0x1)
1166 {
1167 ent->timer = 1.0f;
1168 }
1169
1170 if (is_a_dropper && (ent->state & 0x23))
1171 {
1172 if (ent->dropParent && ent->dropParent->baseType == eBaseTypeStatic &&
1173 !(ent->dropParent->baseFlags & 0x2) &&
1174 (((zEntSimpleObj*)ent->dropParent)->sflags & 0x1))
1175 {
1176 printf("Put back %f %f %f %f %f %f\n", //
1177 ent->model->Mat->pos.x, ent->model->Mat->pos.y, ent->model->Mat->pos.z,
1178 ent->droppos.x, ent->droppos.y, ent->droppos.z);
1179
1180 ent->state = 0x10;
1181
1182 xEntHide(ent);
1183 }
1184 else
1185 {
1186 xVec3Copy((xVec3*)&ent->model->Mat->pos, &ent->droppos);
1187 }

Callers 1

zSceneLoadFunction · 0.70

Calls 6

zEntLoadFunction · 0.85
xEntHideFunction · 0.85
printfFunction · 0.85
xVec3CopyFunction · 0.85
Read_b7Method · 0.80
Read_b1Method · 0.80

Tested by

no test coverage detected