Example #1
0
File: game.c Project: prophile/dim3
void game_reset_single_object(obj_type *obj,bool reposition)
{
	spot_type		*spot;

	obj->score.kill=obj->score.death=obj->score.suicide=obj->score.goal=obj->score.score=0;
	obj->spawning=TRUE;
	
	obj->input_freeze=FALSE;
	obj->death_trigger=FALSE;
	
	object_stop(obj);
	
	if (reposition) {
		spot=script_find_network_spot(obj);
		if (spot!=NULL) object_set_position(obj,spot->pnt.x,spot->pnt.y,spot->pnt.z,spot->ang.y,0);
	}
	
	object_spawn(obj);
}
Example #2
0
JSValueRef js_obj_position_place_network_spot_func(JSContextRef cx,JSObjectRef func,JSObjectRef j_obj,size_t argc,const JSValueRef argv[],JSValueRef *exception)
{
	obj_type		*obj;
	spot_type		*spot;
	
	if (!script_check_param_count(cx,func,argc,0,exception)) return(script_null_to_value(cx));
	
	obj=object_get_attach(j_obj);

		// get spot
		
	spot=script_find_network_spot(cx,obj,exception);
	if (spot==NULL) return(script_null_to_value(cx));
	
		// move player
	
	object_set_position(obj,spot->pnt.x,spot->pnt.y,spot->pnt.z,spot->ang.y,0);
 	object_telefrag_players(obj,FALSE);
   
    return(script_bool_to_value(cx,TRUE));
}