From f0e20434454a4b51e19dd24658987624aecd986f Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 3 Apr 2022 21:01:41 +0300 Subject: [PATCH] Button to open the door on second level(#4) --- Makefile | 37 +++++++++++++++++++++++-------------- src/p_client.c | 16 ++++++++-------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 5f4374d..105885c 100644 --- a/Makefile +++ b/Makefile @@ -33,19 +33,28 @@ endif # Detect the architecture ifeq ($(OSTYPE), Windows) -# At this time only i386 is supported on Windows -ARCH := i386 -# seems like mingw doesn't set CC by default -CC := gcc -else -# Some platforms call it "amd64" and some "x86_64" -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/) +ifdef MINGW_CHOST +ifeq ($(MINGW_CHOST), x86_64-w64-mingw32) +ARCH ?= x86_64 +else # i686-w64-mingw32 +ARCH ?= i386 +endif +else # windows, but MINGW_CHOST not defined +ifdef PROCESSOR_ARCHITEW6432 +# 64 bit Windows +ARCH ?= $(PROCESSOR_ARCHITEW6432) +else +# 32 bit Windows +ARCH ?= $(PROCESSOR_ARCHITECTURE) +endif +endif # windows but MINGW_CHOST not defined +else +ifneq ($(OSTYPE), Darwin) +# Normalize some abiguous ARCH strings +ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/^arm.*/arm/') +else +ARCH ?= $(shell uname -m) endif - -# Refuse all other platforms as a firewall against PEBKAC -# (You'll need some #ifdef for your unsupported platform!) -ifeq ($(findstring $(ARCH), i386 x86_64 sparc64 ia64),) -$(error arch $(ARCH) is currently not supported) endif # ---------- @@ -133,7 +142,7 @@ else else FILESUFFIX := so endif - + smd: @echo "===> Building game.${FILESUFFIX}" ${Q}mkdir -p release @@ -145,7 +154,7 @@ build/%.o: %.c ${Q}$(CC) -c $(CFLAGS) -o $@ $< release/game.${FILESUFFIX} : CFLAGS += -fPIC -endif +endif # ---------- diff --git a/src/p_client.c b/src/p_client.c index ebb9dbf..e12f028 100644 --- a/src/p_client.c +++ b/src/p_client.c @@ -2889,15 +2889,15 @@ void ClientThink (edict_t *ent, usercmd_t *ucmd) { if (pm.touchents[j] == other) break; - - if (j != i) - continue; // duplicated - - if (!other->touch) - continue; - - other->touch (other, ent, NULL, NULL); } + + if (j != i) + continue; // duplicated + + if (!other->touch) + continue; + + other->touch (other, ent, NULL, NULL); } } }