|
|
|
|
@ -1623,21 +1623,22 @@ void SpawnRock()
|
|
|
|
|
if (ActiveItemCount >= MAXITEMS) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
int oi; |
|
|
|
|
bool ostand = false; |
|
|
|
|
for (int i = 0; i < ActiveObjectCount && !ostand; i++) { |
|
|
|
|
oi = ActiveObjects[i]; |
|
|
|
|
ostand = Objects[oi]._otype == OBJ_STAND; |
|
|
|
|
Object *stand = nullptr; |
|
|
|
|
for (int i = 0; i < ActiveObjectCount; i++) { |
|
|
|
|
if (Objects[ActiveObjects[i]]._otype == OBJ_STAND) { |
|
|
|
|
stand = &Objects[ActiveObjects[i]]; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!ostand) |
|
|
|
|
if (stand == nullptr) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
int ii = AllocateItem(); |
|
|
|
|
auto &item = Items[ii]; |
|
|
|
|
|
|
|
|
|
item.position = Objects[oi].position; |
|
|
|
|
dItem[Objects[oi].position.x][Objects[oi].position.y] = ii + 1; |
|
|
|
|
item.position = stand->position; |
|
|
|
|
dItem[item.position.x][item.position.y] = ii + 1; |
|
|
|
|
int curlv = ItemsGetCurrlevel(); |
|
|
|
|
GetItemAttrs(item, IDI_ROCK, curlv); |
|
|
|
|
SetupItem(item); |
|
|
|
|
|