summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 68d9b91)
raw | patch | inline | side by side (parent: 68d9b91)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 5 Apr 2016 21:58:36 +0000 (00:58 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 5 Apr 2016 22:00:27 +0000 (01:00 +0300) |
14 files changed:
diff --git a/src/engine/e_input.pas b/src/engine/e_input.pas
index e8a03f739c54fc28653208d16a638af5143da97e..67e0b5d9a2201ad51cbbf4a4e310cf7f715a5f1d 100644 (file)
--- a/src/engine/e_input.pas
+++ b/src/engine/e_input.pas
function PollJoysticks(): Boolean;
var
- i, j, d: Word;
+ i, j: Word;
hat: Byte;
begin
+ Result := False;
if (Joysticks = nil) or (e_JoysticksAvailable = 0) then Exit;
SDL_JoystickUpdate();
for j := Low(Joysticks) to High(Joysticks) do
begin
hat := SDL_JoystickGetHat(Handle, i);
HatBuf[i, HAT_UP] := LongBool(hat and SDL_HAT_UP);
- HatBuf[i, HAT_DOWN] := LongBool(hat and SDL_HAT_DOWN);
- HatBuf[i, HAT_LEFT] := LongBool(hat and SDL_HAT_LEFT);
- HatBuf[i, HAT_RIGHT] := LongBool(hat and SDL_HAT_RIGHT);
+ HatBuf[i, HAT_DOWN] := LongBool(hat and SDL_HAT_DOWN);
+ HatBuf[i, HAT_LEFT] := LongBool(hat and SDL_HAT_LEFT);
+ HatBuf[i, HAT_RIGHT] := LongBool(hat and SDL_HAT_RIGHT);
end;
end;
- Result := False;
-end;
+end;
procedure GenerateKeyNames();
var
diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas
index b8a185020749e2743f246793b402b78be25bddc5..b877db33511abbfde8f1b28c08dec9acac867130 100644 (file)
--- a/src/engine/e_log.pas
+++ b/src/engine/e_log.pas
WriteTime: Boolean = True);
var
LogFile: TextFile;
- Prefix: ShortString;
+ Prefix: ShortString = '';
begin
if FileName = '' then Exit;
diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas
index e1ce980bc548a2f5e0e7ed16a7f745daab755fe0..4b505ab50bcd76074c76e772a25b76c9aec226f0 100644 (file)
--- a/src/game/g_basic.pas
+++ b/src/game/g_basic.pas
var
a: Integer;
begin
+ Result := '';
for a := 1 to Length(Str) do
if (a = Length(Str)) or (Str[a+1] = ' ') then
begin
n := 1;
m := 1;
Result := 0;
+ s1 := '';
for i := 0 to High(Pointers) do
begin
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 3c1603744276a18bd6bc36a39cf877a81f636657..fc78ef05502bd56ac0e99bd60fe7ffde303befc0 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
var
a: Integer;
begin
+ Result := '';
for a := 1 to Length(Str) do
if (a = Length(Str)) or (Str[a+1] = ';') then
begin
F: TextFile;
begin
Cmd := LowerCase(P[0]);
+ s := '';
if Cmd = 'clear' then
begin
var
a, b: Integer;
begin
+ Result := '';
if Str[1] = '"' then
begin
for b := 1 to Length(Str) do
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 9adfa22fdb090e853788b848391d0312a645827a..13ffb1064132327dbe8d6cff0d81522af9f9fb96 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
wad, map: string;
mapstr: string;
begin
+ s1 := '';
+ s2 := '';
+ s3 := '';
pc := g_Player_GetCount;
e_TextureFontGetSize(gStdFont, cw, ch);
s, pw: String;
chstr: string;
cmd: string;
- pl: pTNetClient;
+ pl: pTNetClient = nil;
plr: TPlayer;
prt: Word;
nm: Boolean;
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 9e14586931983da8adc19b0c6e95b0f3134844e5..aa0c4cb0307de5157bec744f5942cd13eb7ceef5 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
begin
Result := False;
gMapInfo.Map := Res;
+ TriggersTable := nil;
+ FillChar(texture, SizeOf(texture), 0);
// Çàãðóçêà WAD:
g_ProcessResourceStr(Res, FileName, SectionName, ResName);
Data: Pointer;
Len: Integer;
begin
+ FillChar(Result, SizeOf(Result), 0);
g_ProcessResourceStr(Res, FileName, SectionName, ResName);
WAD := TWADEditor_1.Create();
index 507a56024cf75640394dbe91dd3bd4ccaa45b45a..15790197f17980f45913930944a37349e8bec432 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
function g_Monsters_GetNameByID(MonsterType: Byte): String;
begin
if MonsterType in [MONSTER_DEMON..MONSTER_MAN] then
- Result := MONSTERTABLE[MonsterType].Name;
+ Result := MONSTERTABLE[MonsterType].Name
+ else
+ Result := '?';
end;
function g_Monsters_GetKilledBy(MonsterType: Byte): String;
diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index 74defc3d1083f613d89e67f59da2a879a4c9acc1..a1c07701018a99b84c38dcf198214d923bbd0e77 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
Ptr: Pointer;
msgStream: TMemoryStream;
begin
+ FillChar(downloadEvent, SizeOf(downloadEvent), 0);
msgStream := nil;
OuterLoop := True;
while OuterLoop do
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 27b8081f4733b7aa68efc041860a2e40ba38772f..7cc04d223065c043946347a45bc23b08497aef5c 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
pln: String;
cnt: Byte;
begin
+ FillChar(EvHash, Sizeof(EvHash), 0);
EvType := e_Raw_Read_Byte(P);
EvNum := e_Raw_Read_LongInt(P);
EvStr := e_Raw_Read_String(P);
index 283113e0dc5e4f4f33bfae98e848a7f0a78f4df0..a00982375150601c281aaae19232330e4405a027 100644 (file)
s: String;
begin
Result := False;
+ x := 0;
+ y := 0;
str := Trim(str);
if Length(str) < 3 then
var
a: Integer;
begin
+ FillChar(Result, SizeOf(Result), 0);
if PlayerModelsArray = nil then Exit;
for a := 0 to High(PlayerModelsArray) do
index e4959b719de4325dd9ec2aab5077d909f8f971b0..9547335009a7296361e17b018196f7e6846c3278 100644 (file)
i: Integer;
resData: TResDataMsg;
begin
+ SetLength(mapData.ExternalResources, 0);
g_Console_Add(Format(_lc[I_NET_MAP_DL], [FileName]));
e_WriteLog('Downloading map `' + FileName + '` from server', MSG_NOTIFY);
MC_SEND_MapRequest();
index 6748a005098b7874218adc0e15af4fcd3fa5a631..d1b2c67a43a94a473d45d508cb898f4d0eae6ad5 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
k: Byte;
p: TPlayer;
begin
+ Result := nil;
+
if gTriggers = nil then Exit;
case g_GetUIDType(UID) of
else k := 0;
end;
- Result := nil;
-
for a := 0 to High(gTriggers) do
if (gTriggers[a].TriggerType <> TRIGGER_NONE) and
(gTriggers[a].TimeOut = 0) and
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index bb20c47dd3feba89956de37b19402342bcbdecc8..8427dd30667efdf4cec6fae89589dde49f6b7f3d 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
// TODO: make a transition table or something
function WCharToCP1251(wc: Word): Word;
+var
+ n: Word;
begin
- for Result := 0 to 127 do
- if CP1251[Result] = wc then
- break;
+ Result := 0;
+ for n := 0 to 127 do
+ if CP1251[n] = wc then begin Result := n; break end;
Result := Result + 128;
end;
ev: TSDL_Event;
ID: DWORD;
begin
+ FillChar(ev, SizeOf(ev), 0);
//wNeedFree := False;
wLoadingProgress := True;
while SDL_PollEvent(@ev) > 0 do
ev: TSDL_Event;
begin
Result := False;
+ FillChar(ev, SizeOf(ev), 0);
while SDL_PollEvent(@ev) > 0 do
begin
index 3c6c1a3082fc80c9290ace750a56bc3921b963a0..83538c0525bdbe09ad97aeb443c2b6fb8ca545e2 100644 (file)
--- a/src/shared/WADEDITOR.pas
+++ b/src/shared/WADEDITOR.pas
DFWAD_ERROR_WADNOTLOADED: Result := 'DFWAD file is not loaded';
DFWAD_ERROR_READRESOURCE: Result := 'Read resource error';
DFWAD_ERROR_READWAD: Result := 'Read DFWAD error';
+ else Result := 'Unknown DFWAD error';
end;
end;