MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / ExtractObject

Function ExtractObject

clientd3d/server.c:319–352  ·  view source on GitHub ↗

/ * ExtractObject: Get an object_node from ptr, and increment * ptr appropriately. Place data in given object node. */

Source from the content-addressed store, hash-verified

317 * ptr appropriately. Place data in given object node.
318 */
319void ExtractObject(char **ptr, object_node *item, bool includeLight)
320{
321 Extract(ptr, &item->id, SIZE_ID);
322 if (IsNumberObj(item->id))
323 Extract(ptr, &item->amount, SIZE_AMOUNT);
324 else
325 item->amount = 0;
326 Extract(ptr, &item->icon_res, SIZE_ID);
327 Extract(ptr, &item->name_res, SIZE_ID);
328 Extract(ptr, &item->flags, 4); // includes drawfx_mask bits
329 Extract(ptr, &item->rarity, SIZE_ID);
330
331 if (includeLight)
332 ExtractDLighting(ptr, &item->dLighting);
333
334 ExtractPaletteTranslation(ptr,&item->translation,&item->effect);
335 item->normal_translation = item->translation;
336 item->secondtranslation = XLAT_FILTERWHITE90;
337
338 ExtractAnimation(ptr, &item->normal_animate);
339 item->animate = &item->normal_animate;
340
341 item->normal_overlays = ExtractOverlays(ptr);
342 item->overlays = &item->normal_overlays;
343
344 if (OF_BOUNCING == (OF_BOUNCING & item->flags))
345 {
346 item->bounceTime = (WORD)(rand() % 1000);
347 }
348 if (OF_PHASING == (OF_PHASING & item->flags))
349 {
350 item->phaseTime = (WORD)(rand() % 1000);
351 }
352}
353
354void ExtractObjectNoLight(char **ptr, object_node *item)
355{

Callers 12

HandleLookNewsgroupFunction · 0.85
ExtractNewSpellFunction · 0.85
ExtractNewSkillFunction · 0.85
HandleLookPlayerFunction · 0.85
ExtractObjectNoLightFunction · 0.85
ExtractNewObjectFunction · 0.85
ExtractNewRoomObjectFunction · 0.85
HandleChangeFunction · 0.85
HandleLookFunction · 0.85
HandleOfferFunction · 0.85
HandleBuyListFunction · 0.85
HandleWithdrawalListFunction · 0.85

Calls 5

ExtractFunction · 0.85
ExtractDLightingFunction · 0.85
ExtractAnimationFunction · 0.85
ExtractOverlaysFunction · 0.85

Tested by

no test coverage detected