]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some guide code microoptimizations
authorotta8634 <k9wolf@pm.me>
Sun, 16 Feb 2025 10:22:46 +0000 (18:22 +0800)
committerotta8634 <k9wolf@pm.me>
Sun, 16 Feb 2025 10:22:46 +0000 (18:22 +0800)
/2 -> 0.5
n++; -> ++n;

qcsrc/menu/xonotic/dialog_singleplayer.qc
qcsrc/menu/xonotic/guide/guide.qc

index 69de8c089b77b78cf36abce1413e682b68a1cba1..64bfa8cfe6a5c8aaea500db0d904e75744d60cbb 100644 (file)
@@ -146,7 +146,7 @@ void XonoticSingleplayerDialog_fill(entity me)
        entity e, btnPrev, btnNext, lblTitle;
 
        me.TR(me);
-               me.TDempty(me, (me.columns / 2) - 2);
+               me.TDempty(me, (me.columns * 0.5) - 2);
                me.TD(me, 2, 2, e = makeXonoticBigButton(_("Instant action with bots!"), '0 0 0'));
                        e.onClick = InstantAction_LoadMap;
                        e.onClickEntity = NULL;
index e6f938f3e095b002e1597111ee37352d18513cdc..d2a5dbf69712ede8e6620a2ea4061b05f8340b9a 100644 (file)
@@ -19,7 +19,7 @@ METHOD(TopicSource, getEntry, entity(TopicSource this, int i, void(string, strin
 METHOD(TopicSource, reload, int(TopicSource this, string filter))
 {
        int n = 0;
-       #define TOPIC(src, name, icon) n++;
+       #define TOPIC(src, name, icon) ++n;
        TOPICS(TOPIC);
        #undef TOPIC
        return n;