349 {
350 if (!item_name)
351 {
352 return;
353 }
355 {
356 float rowDist = 0;
357 float columnDist = 0;
358
359 vector playerPos;
360 vector camDirForward;
361
363
364 vector camDirRight = camDirForward.
Perpend() * -1;
365 int countLoop = 0;
366 for (int i = 0; i < rows; i++)
367 {
368 vector posRow = playerPos + camDirForward * rowDist;
369 vector offsetSide;
370 columnDist = 0;
371 for (int j = 0; j < columns; j++)
372 {
373 offsetSide = camDirRight * columnDist;
374 vector placement = posRow + offsetSide;
375 float hlth = health * MiscGameplayFunctions.GetTypeMaxGlobalHealth( item_name );
377 ent.PlaceOnSurface();
378
379 InventoryItem item;
380 if (Class.CastTo(item, ent) && withPhysics)
381 item.ThrowPhysically(null, "0 0 0");
382
383 countLoop++;
384 if (countLoop == count)
385 {
386 return;
387 }
388 columnDist += gapColumn;
389 }
390 rowDist += gapRow;
391 }
392 }
393 else
394 {
395 auto params = new Param10<string, int, float, float, int, int, float, float, bool, bool>(item_name, count, health, quantity, rows, columns, gapRow, gapColumn, special, withPhysics);
396 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID, params,
true);
397 }
398 }
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string object_name, vector pos)
void GetCameraDirections(Man player, bool allowFreeflight, out vector position, out vector direction)
vector Perpend()
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector ...