X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fnet.qh;h=fe2952e2c4025c3d5f84854627824cc3f4ab3d6f;hb=c28229c0d08c59c021e6fe31977e3b493581f11e;hp=b1f5326a9bb5a441b5094de347cfe973086d5bd6;hpb=a1372cef7e6aa5fc6f92777b990c8adbf4723d19;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index b1f5326a9..fe2952e2c 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -304,6 +304,11 @@ MACRO_END if (g_buf) strunzone(g_buf); g_buf = strzone(tmp); } + void WriteShort(int to, int b) + { + WriteByte(to, (b >> 8) & 0xFF); + WriteByte(to, b & 0xFF); + } #elif defined(SVQC) int ReadByte() { @@ -311,6 +316,10 @@ MACRO_END ydec_single(g_buf, ret); return ret; } + int ReadShort() + { + return (ReadByte() << 8) | (ReadByte()); + } void WriteByte(int to, int b); #endif