about summary refs log tree commit diff
path: root/src/engine/e_ringbuffer.c
diff options
context:
space:
mode:
authorJakob Fries <jakob.fries@gmail.com>2008-02-04 00:13:34 +0000
committerJakob Fries <jakob.fries@gmail.com>2008-02-04 00:13:34 +0000
commitd76661b3be30a78203438d53bd91657006d930a9 (patch)
treef70fcb4dd6128c980dfd8f035d8a8073aa220bcb /src/engine/e_ringbuffer.c
parentbe33e56abccb9459419ffa5376774332c06b517d (diff)
downloadzcatch-d76661b3be30a78203438d53bd91657006d930a9.tar.gz
zcatch-d76661b3be30a78203438d53bd91657006d930a9.zip
console now has proper backlog and command history. kill command added. predicted hooks no longer make a sound when hitting a player.
Diffstat (limited to 'src/engine/e_ringbuffer.c')
-rw-r--r--src/engine/e_ringbuffer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/e_ringbuffer.c b/src/engine/e_ringbuffer.c
index f6f529f8..9ece9b98 100644
--- a/src/engine/e_ringbuffer.c
+++ b/src/engine/e_ringbuffer.c
@@ -206,9 +206,11 @@ void *ringbuf_item_ptr(void *p)
 	return ((RBITEM *)p) - 1;
 }
 
-void *ringbuf_first(RINGBUFFER *rb)
-{
-	return ringbuf_next(rb, rb->last_alloc+1);
+void *ringbuf_first(RINGBUFFER *rb) 
+{ 
+    if(rb->last_alloc && rb->last_alloc->next) 
+        return ringbuf_next(rb, rb->last_alloc->next+1); 
+    return 0x0; 
 }
 
 void *ringbuf_last(RINGBUFFER *rb)