networking appears to work now

This commit is contained in:
Dave Griffiths 2009-08-12 14:33:44 +01:00
parent a2d5a7cf02
commit 610762c1ee

View file

@ -362,7 +362,7 @@
(pos (vector 0 0 0)) (pos (vector 0 0 0))
(size 0) (size 0)
(col (vector 1 1 1)) (col (vector 1 1 1))
(tex "ooo")) (tex ""))
(field (field
(twigs '()) ; a assoc list map between ids and twigs stored flat here, (twigs '()) ; a assoc list map between ids and twigs stored flat here,
@ -467,16 +467,19 @@
(set! twigs (cons (list (send twig get-id) twig) twigs)))) (set! twigs (cons (list (send twig get-id) twig) twigs))))
(define/public (add-twig-point twig-id point width) (define/public (add-twig-point twig-id point width)
(send (get-twig twig-id) add-point point width)) (when (get-twig twig-id)
(send (get-twig twig-id) add-point point width)))
(define/public (start-twig-growing twig-id) (define/public (start-twig-growing twig-id)
(send (get-twig twig-id) start-growing)) (when (get-twig twig-id)
(send (get-twig twig-id) start-growing)))
(define/public (grow-seed amount) (define/public (grow-seed amount)
(with-primitive seed (scale amount))) (with-primitive seed (scale amount)))
(define/public (add-ornament twig-id point-index property) (define/public (add-ornament twig-id point-index property)
(send (get-twig twig-id) add-ornament point-index property)) (when (get-twig twig-id)
(send (get-twig twig-id) add-ornament point-index property)))
(define/public (update-nutrients t d) (define/public (update-nutrients t d)
(when (not (null? twigs)) (when (not (null? twigs))
@ -659,10 +662,12 @@
(send (get-plant plant-id) destroy-branch-twig twig-id)) (send (get-plant plant-id) destroy-branch-twig twig-id))
(define/public (add-twig plant-id parent-twig-id point-index twig) (define/public (add-twig plant-id parent-twig-id point-index twig)
(send (get-plant plant-id) add-twig parent-twig-id point-index twig)) (when (get-plant plant-id)
(send (get-plant plant-id) add-twig parent-twig-id point-index twig)))
(define/public (grow-seed plant-id amount) (define/public (grow-seed plant-id amount)
(send (get-plant plant-id) grow-seed amount)) (when (get-plant plant-id)
(send (get-plant plant-id) grow-seed amount)))
(define/public (get-pickup pickup-id) (define/public (get-pickup pickup-id)
(cadr (assq pickup-id pickups))) (cadr (assq pickup-id pickups)))
@ -675,7 +680,8 @@
(set! pickups (assoc-remove pickup-id pickups))) (set! pickups (assoc-remove pickup-id pickups)))
(define/public (add-ornament plant-id twig-id point-index property) (define/public (add-ornament plant-id twig-id point-index property)
(send (get-plant plant-id) add-ornament twig-id point-index property)) (when (get-plant plant-id)
(send (get-plant plant-id) add-ornament twig-id point-index property)))
(define/public (update t d messages) (define/public (update t d messages)