297 {
300 int type = 0;
301 int idx = -1;
302 int row = -1;
303 int col = -1;
304 bool flp = false;
306 return false;
307
308 switch (type)
309 {
311 {
312 break;
313 }
315 {
317 return false;
318 vector pos;
320 return false;
321
322 float dir[4];
324 return false;
325
326 if (!item)
327 {
328#ifdef ENABLE_LOGGING
329#ifdef SERVER
330 Debug.Log(
string.Format(
"Item=%1 does not exist on server!",
Object.GetDebugName(item)),
"GROUND" ,
"n/a",
"ReadFromContext",
this.ToString() );
331#endif
332#endif
333 break;
334 }
335
337 break;
338 }
340 {
341 if (!ctx.
Read(parent))
342 return false;
344 return false;
345 int slot;
347 return false;
348
349 if (!parent || !item)
350 {
351#ifdef ENABLE_LOGGING
352#ifdef SERVER
353 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() );
354#endif
355#endif
356 break;
357 }
358
360 break;
361 }
363 {
364 if (!ctx.
Read(parent))
365 return false;
367 return false;
369 return false;
371 return false;
373 return false;
375 return false;
376
377 if (!parent || !item)
378 {
379#ifdef ENABLE_LOGGING
380#ifdef SERVER
381 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() );
382#endif
383#endif
384 break;
385 }
386
387 SetCargo(parent, item, idx, row, col, flp);
388 break;
389 }
391 {
392 if (!ctx.
Read(parent))
393 return false;
395 return false;
396
397 if (!parent || !item)
398 {
399#ifdef ENABLE_LOGGING
400#ifdef SERVER
401 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() );
402#endif
403#endif
404 break;
405 }
406
408 break;
409 }
411 {
412 if (!ctx.
Read(parent))
413 return false;
415 return false;
417 return false;
419 return false;
421 return false;
423 return false;
424
425 if (!parent || !item)
426 {
427#ifdef ENABLE_LOGGING
428#ifdef SERVER
429 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() );
430#endif
431#endif
432 break;
433 }
434
436 break;
437 }
439 {
440 if (!ctx.
Read(parent))
441 return false;
443 return false;
445 return false;
446
447 if (!parent || !item)
448 {
449#ifdef ENABLE_LOGGING
450#ifdef SERVER
451 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() );
452#endif
453#endif
454 break;
455 }
456
458 break;
459 }
460 default:
461 {
462 ErrorEx(
"ReadFromContext - really unknown location type, this should not happen, type=" + type);
463 return false;
464 }
465 }
466 return true;
467 }
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)