Doom 2D Forever

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Core
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Normal
  • Reported Version 0.667b
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 0
  • Private No
Attached to Project: Doom 2D Forever
Opened by Joseph Stalin (GranMinigun) - 2018-12-19

FS#57 - Переписать назначение UID монстров

В g_basic.pas, строка 217:

function g_CreateUID(UIDType: Byte): Word;
var
ok: Boolean;
i: Integer;
begin
Result := $0;

case UIDType of
<...>
UID_MONSTER:
begin
//FIXME!!!
while true do
begin
result := UID_MAX_PLAYER+$1+Random(UID_MAX_MONSTER-UID_MAX_GAME-UID_MAX_PLAYER+$1);
if (g_Monsters_ByUID(result) = nil) then break;
end;
end;
end;
end;

ketmar: по уму надо иметь нормальный range list свободных уидов, из которого и выбирать случайный при помощи операции O(n)
ketmar: O(1), то есть

This task does not depend on any other tasks.

Loading...