# HG changeset patch # User Matti Hamalainen # Date 1317001225 -10800 # Node ID 29a5fac5c75fae5094ee7f048982bcdb7551a1cd # Parent a521308b47fb3ff2ed17e904b26c1ce63a3f9495 Use helper functions here too. diff -r a521308b47fb -r 29a5fac5c75f src/checks.cc --- a/src/checks.cc Mon Sep 26 04:40:02 2011 +0300 +++ b/src/checks.cc Mon Sep 26 04:40:25 2011 +0300 @@ -39,6 +39,7 @@ #include "objid.h" #include "oldmenus.h" #include "selectn.h" +#include "textures.h" static void CheckingObjects(); @@ -666,7 +667,7 @@ s2 = OBJ_NO_NONE; if (is_obj(s1) && !is_obj(s2)) { - if (SideDefs[sd1].tex3[0] == '-' && SideDefs[sd1].tex3[1] == '\0') + if (InvalidTextureName(SideDefs[sd1].tex3)) { sprintf(msg1, "Error in one-sided linedef #%d:" " sidedef #%d has no middle texture", n, sd1); @@ -685,8 +686,8 @@ } if (is_obj(s1) && is_obj(s2) && Sectors[s1].ceilh > Sectors[s2].ceilh) { - if (SideDefs[sd1].tex1[0] == '-' && SideDefs[sd1].tex1[1] == '\0' - && (!is_sky(Sectors[s1].ceilt) || !is_sky(Sectors[s2].ceilt))) + if (InvalidTextureName(SideDefs[sd1].tex1) && + (!is_sky(Sectors[s1].ceilt) || !is_sky(Sectors[s2].ceilt))) { sprintf(msg1, "Error in first sidedef of linedef #%d:" " sidedef #%d has no upper texture", n, sd1); @@ -706,7 +707,7 @@ if (is_obj(s1) && is_obj(s2) && Sectors[s1].floorh < Sectors[s2].floorh) { - if (SideDefs[sd1].tex2[0] == '-' && SideDefs[sd1].tex2[1] == '\0') + if (InvalidTextureName(SideDefs[sd1].tex2)) { sprintf(msg1, "Error in first sidedef of linedef #%d:" " sidedef #%d has no lower texture", n, sd1); @@ -725,8 +726,8 @@ } if (is_obj(s1) && is_obj(s2) && Sectors[s2].ceilh > Sectors[s1].ceilh) { - if (SideDefs[sd2].tex1[0] == '-' && SideDefs[sd2].tex1[1] == '\0' - && (!is_sky(Sectors[s1].ceilt) || !is_sky(Sectors[s2].ceilt))) + if (InvalidTextureName(SideDefs[sd2].tex1) && + (!is_sky(Sectors[s1].ceilt) || !is_sky(Sectors[s2].ceilt))) { sprintf(msg1, "Error in second sidedef of linedef #%d:" " sidedef #%d has no upper texture", n, sd2); @@ -746,7 +747,7 @@ if (is_obj(s1) && is_obj(s2) && Sectors[s2].floorh < Sectors[s1].floorh) { - if (SideDefs[sd2].tex2[0] == '-' && SideDefs[sd2].tex2[1] == '\0') + if (InvalidTextureName(SideDefs[sd2].tex2)) { sprintf(msg1, "Error in second sidedef of linedef #%d:" " sidedef #%d has no lower texture", n, sd2); @@ -930,11 +931,8 @@ if (dm == 0) sprintf(msg1, "Warning: there are no deathmatch starts." " You need at least %d", DOOM_MIN_DEATHMATCH_STARTS); - else if (dm == 1) - sprintf(msg1, "Warning: there is only one deathmatch start." - " You need at least %d", DOOM_MIN_DEATHMATCH_STARTS); else - sprintf(msg1, "Warning: there are only %d deathmatch starts." + sprintf(msg1, "Warning: there are only %d deathmatch start(s)." " You need at least %d", dm, DOOM_MIN_DEATHMATCH_STARTS); sprintf(msg2, "deathmatch starts to play deathmatch games." " Save anyway ?");