311 {
314 int type = 0;
315 int idx = -1;
316 int row = -1;
317 int col = -1;
318 bool flp = false;
320 return false;
321
322 switch (type)
323 {
325 {
326 break;
327 }
329 {
331 return false;
332 vector pos;
334 return false;
335
336 float dir[4];
338 return false;
339
340 if (!item)
341 {
342#ifdef ENABLE_LOGGING
343#ifdef SERVER
344 Debug.Log(
string.Format(
"Item=%1 does not exist on server!",
Object.GetDebugName(item)),
"GROUND" ,
"n/a",
"ReadFromContext",
this.ToString() );
345#endif
346#endif
347 break;
348 }
349
351 break;
352 }
354 {
355 if (!ctx.
Read(parent))
356 return false;
358 return false;
359 int slot;
361 return false;
362
363 if (!parent || !item)
364 {
365#ifdef ENABLE_LOGGING
366#ifdef SERVER
367 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"ATTACHMENT" ,
"n/a",
"ReadFromContext",
this.ToString() );
368#endif
369#endif
370 break;
371 }
372
374 break;
375 }
377 {
378 if (!ctx.
Read(parent))
379 return false;
381 return false;
383 return false;
385 return false;
387 return false;
389 return false;
390
391 if (!parent || !item)
392 {
393#ifdef ENABLE_LOGGING
394#ifdef SERVER
395 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"CARGO" ,
"n/a",
"ReadFromContext",
this.ToString() );
396#endif
397#endif
398 break;
399 }
400
401 SetCargo(parent, item, idx, row, col, flp);
402 break;
403 }
405 {
406 if (!ctx.
Read(parent))
407 return false;
409 return false;
410
411 if (!parent || !item)
412 {
413#ifdef ENABLE_LOGGING
414#ifdef SERVER
415 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"HANDS" ,
"n/a",
"ReadFromContext",
this.ToString() );
416#endif
417#endif
418 break;
419 }
420
422 break;
423 }
425 {
426 if (!ctx.
Read(parent))
427 return false;
429 return false;
431 return false;
433 return false;
435 return false;
437 return false;
438
439 if (!parent || !item)
440 {
441#ifdef ENABLE_LOGGING
442#ifdef SERVER
443 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"PROXYCARGO" ,
"n/a",
"ReadFromContext",
this.ToString() );
444#endif
445#endif
446 break;
447 }
448
450 break;
451 }
453 {
454 if (!ctx.
Read(parent))
455 return false;
457 return false;
459 return false;
460
461 if (!parent || !item)
462 {
463#ifdef ENABLE_LOGGING
464#ifdef SERVER
465 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"VEHICLE" ,
"n/a",
"ReadFromContext",
this.ToString() );
466#endif
467#endif
468 break;
469 }
470
472 break;
473 }
474
476 {
477 if (!ctx.
Read(parent))
478 return false;
480 return false;
481
482 int tmp;
484 return false;
485
486 if (!parent || !item)
487 {
488#ifdef ENABLE_LOGGING
489#ifdef SERVER
490 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"TEMP" ,
"n/a",
"ReadFromContext",
this.ToString() );
491#endif
492#endif
493 break;
494 }
496
497 }
498 default:
499 {
500 ErrorEx(
"ReadFromContext - really unknown location type, this should not happen, type=" + type);
501 return false;
502 }
503 }
504 return true;
505 }
InventoryLocationType
types of Inventory Location
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native void SetProxyCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to ProxyCargo with coordinates (idx, row, col) @NOTE: typical us...
proto native void SetVehicle(notnull EntityAI parent, EntityAI e, int idx)
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
sets current inventory location type to Ground with transformation mat
proto bool Read(void value_in)