diff --git a/fs2_open/code/parse/lua.cpp b/fs2_open/code/parse/lua.cpp index 6777737d13..38eb471c94 100644 --- a/fs2_open/code/parse/lua.cpp +++ b/fs2_open/code/parse/lua.cpp @@ -339,7 +339,7 @@ ADE_INDEXER(l_Matrix, "p,b,h or 0-9", "Orientation component - pitch, bank, head matrix_h *mh; char *s = NULL; float newval = 0.0f; - int numargs = ade_get_args(L, "os|f", l_Matrix.GetPtr(&mh), &s, &newval); + int numargs = ade_get_args(L, "os|f", l_Matrix.GetPtr(&mh), &s, &newval); //-V510 if(!numargs || s[1] != '\0') return ade_set_error(L, "f", 0.0f); @@ -397,20 +397,20 @@ ADE_INDEXER(l_Matrix, "p,b,h or 0-9", "Orientation component - pitch, bank, head ADE_FUNC(__mul, l_Matrix, "orientation", "Multiplies two matrix objects)", "orientation", "matrix, or empty matrix if unsuccessful") { matrix_h *mha=NULL, *mhb=NULL; - if(!ade_get_args(L, "oo", l_Matrix.GetPtr(&mha), l_Matrix.GetPtr(&mhb))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "oo", l_Matrix.GetPtr(&mha), l_Matrix.GetPtr(&mhb))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 matrix mr; vm_matrix_x_matrix(&mr, mha->GetMatrix(), mhb->GetMatrix()); - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&mr))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&mr))); //-V510 } ADE_FUNC(__tostring, l_Matrix, NULL, "Converts a matrix to a string with format \"[r1c1 r2c1 r3c1 | r1c2 r2c2 r3c2| r1c3 r2c3 r3c3]\"", "string", "Formatted string or \""); char buf[128]; @@ -425,8 +425,8 @@ ADE_FUNC(getInterpolated, l_Matrix, "orientation Final, number Factor", "Returns matrix_h *oriA = NULL; matrix_h *oriB = NULL; float factor = 0.0f; - if(!ade_get_args(L, "oof", l_Matrix.GetPtr(&oriA), l_Matrix.GetPtr(&oriB), &factor)) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "oof", l_Matrix.GetPtr(&oriA), l_Matrix.GetPtr(&oriB), &factor)) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 matrix *A = oriA->GetMatrix(); matrix *B = oriB->GetMatrix(); @@ -438,19 +438,19 @@ ADE_FUNC(getInterpolated, l_Matrix, "orientation Final, number Factor", "Returns final.a1d[i] = A->a1d[i] + (B->a1d[i] - A->a1d[i])*factor; } - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&final))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&final))); //-V510 } ADE_FUNC(getTranspose, l_Matrix, NULL, "Returns a transpose version of the specified orientation", "orientation", "Transpose matrix, or null orientation on failure") { matrix_h *mh = NULL; - if(!ade_get_args(L, "o", l_Matrix.GetPtr(&mh))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "o", l_Matrix.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 matrix final = *mh->GetMatrix(); vm_transpose_matrix(&final); - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&final))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&final))); //-V510 } @@ -458,26 +458,26 @@ ADE_FUNC(rotateVector, l_Matrix, "vector Input", "Returns rotated version of giv { matrix_h *mh; vec3d *v3; - if(!ade_get_args(L, "oo", l_Matrix.GetPtr(&mh), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "oo", l_Matrix.GetPtr(&mh), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 vec3d v3r; vm_vec_rotate(&v3r, v3, mh->GetMatrix()); - return ade_set_args(L, "o", l_Vector.Set(v3r)); + return ade_set_args(L, "o", l_Vector.Set(v3r)); //-V510 } ADE_FUNC(unrotateVector, l_Matrix, "vector Input", "Returns unrotated version of given vector", "vector", "Unrotated vector, or empty vector on error") { matrix_h *mh; vec3d *v3; - if(!ade_get_args(L, "oo", l_Matrix.GetPtr(&mh), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "oo", l_Matrix.GetPtr(&mh), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 vec3d v3r; vm_vec_unrotate(&v3r, v3, mh->GetMatrix()); - return ade_set_args(L, "o", l_Vector.Set(v3r)); + return ade_set_args(L, "o", l_Vector.Set(v3r)); //-V510 } //**********OBJECT: constant class @@ -790,19 +790,19 @@ ade_obj l_Enum("enumeration", "Enumeration object"); ADE_FUNC(__newindex, l_Enum, "enumeration", "Sets enumeration to specified value (if it is not a global", "enumeration", "enumeration") { enum_h *e1=NULL, *e2=NULL; - if(!ade_get_args(L, "oo", l_Enum.GetPtr(&e1), l_Enum.GetPtr(&e2))) - return ade_set_error(L, "o", l_Enum.Set(enum_h())); + if(!ade_get_args(L, "oo", l_Enum.GetPtr(&e1), l_Enum.GetPtr(&e2))) //-V510 + return ade_set_error(L, "o", l_Enum.Set(enum_h())); //-V510 if(!e1->is_constant) e1->index = e2->index; - return ade_set_args(L, "o", l_Enum.Set(*e1)); + return ade_set_args(L, "o", l_Enum.Set(*e1)); //-V510 } ADE_FUNC(__tostring, l_Enum, NULL, "Returns enumeration name", "string", "Enumeration name, or \"\" if invalid") { enum_h *e = NULL; - if(!ade_get_args(L, "o", l_Enum.GetPtr(&e))) + if(!ade_get_args(L, "o", l_Enum.GetPtr(&e))) //-V510 return ade_set_args(L, "s", ""); if(e->index < 0 || e->index >= (int)Num_enumerations) @@ -825,7 +825,7 @@ ADE_VIRTVAR(Name, l_Event, "string", "Mission event name", "string", NULL) { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Event.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Event.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Num_mission_events) @@ -844,7 +844,7 @@ ADE_VIRTVAR(DirectiveText, l_Event, "string", "Directive text", "string", NULL) { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Event.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Event.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Num_mission_events) @@ -869,7 +869,7 @@ ADE_VIRTVAR(DirectiveKeypressText, l_Event, "string", "Raw directive keypress te { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Event.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Event.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Num_mission_events) @@ -894,7 +894,7 @@ ADE_VIRTVAR(Interval, l_Event, "number", "Time for event to repeat (in seconds)" { int idx; int newinterval = 0; - if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newinterval)) + if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newinterval)) //-V510 return ade_set_error(L, "i", 0); if(idx < 0 || idx >= Num_mission_events) @@ -913,7 +913,7 @@ ADE_VIRTVAR(ObjectCount, l_Event, "number", "Number of objects left for event", { int idx; int newobject = 0; - if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newobject)) + if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newobject)) //-V510 return ade_set_error(L, "i", 0); if(idx < 0 || idx >= Num_mission_events) @@ -932,7 +932,7 @@ ADE_VIRTVAR(RepeatCount, l_Event, "number", "Event repeat count", "number", "Rep { int idx; int newrepeat = 0; - if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newrepeat)) + if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newrepeat)) //-V510 return ade_set_error(L, "i", 0); if(idx < 0 || idx >= Num_mission_events) @@ -951,7 +951,7 @@ ADE_VIRTVAR(Score, l_Event, "number", "Event score", "number", "Event score, or { int idx; int newscore = 0; - if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newscore)) + if(!ade_get_args(L, "o|i", l_Event.Get(&idx), &newscore)) //-V510 return ade_set_error(L, "i", 0); if(idx < 0 || idx >= Num_mission_events) @@ -969,7 +969,7 @@ ADE_VIRTVAR(Score, l_Event, "number", "Event score", "number", "Event score, or ADE_FUNC(isValid, l_Event, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Event.Get(&idx))) + if(!ade_get_args(L, "o", l_Event.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_mission_events) @@ -988,7 +988,7 @@ ade_obj l_File("file", "File handle"); ADE_FUNC(isValid, l_File, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { CFILE *cfp = NULL; - if(!ade_get_args(L, "o", l_File.Get(&cfp))) + if(!ade_get_args(L, "o", l_File.Get(&cfp))) //-V510 return ADE_RETURN_NIL; if(!cf_is_valid(cfp)) @@ -1000,7 +1000,7 @@ ADE_FUNC(isValid, l_File, NULL, "Detects whether handle is valid", "boolean", "t ADE_FUNC(close, l_File, NULL, "Instantly closes file and invalidates all file handles", NULL, NULL) { CFILE *cfp; - if(!ade_get_args(L, "o", l_File.Get(&cfp))) + if(!ade_get_args(L, "o", l_File.Get(&cfp))) //-V510 return ADE_RETURN_FALSE; if(!cf_is_valid(cfp)) @@ -1018,7 +1018,7 @@ ADE_FUNC(close, l_File, NULL, "Instantly closes file and invalidates all file ha ADE_FUNC(flush, l_File, NULL, "Flushes file buffer to disk.", "boolean", "True for success, false on failure") { CFILE *cfp = NULL; - if(!ade_get_args(L, "o", l_File.Get(&cfp))) + if(!ade_get_args(L, "o", l_File.Get(&cfp))) //-V510 return ADE_RETURN_FALSE; if(!cf_is_valid(cfp)) @@ -1032,7 +1032,7 @@ ADE_FUNC(flush, l_File, NULL, "Flushes file buffer to disk.", "boolean", "True f ADE_FUNC(getPath, l_File, NULL, "Determines path of the given file", "string", "Path string of the file handle, or an empty string if it doesn't have one, or the handle is invalid") { CFILE *cfp = NULL; - if(!ade_get_args(L, "o", l_File.Get(&cfp))) + if(!ade_get_args(L, "o", l_File.Get(&cfp))) //-V510 return ade_set_error(L, "s", ""); if(!cf_is_valid(cfp)) @@ -1057,7 +1057,7 @@ ADE_FUNC(read, l_File, "number or string, ...", "Requested data, or nil if the function fails") { CFILE *cfp = NULL; - if(!ade_get_args(L, "o", l_File.Get(&cfp))) + if(!ade_get_args(L, "o", l_File.Get(&cfp))) //-V510 return ADE_RETURN_NIL; if(!cf_is_valid(cfp)) @@ -1172,7 +1172,7 @@ ADE_FUNC(seek, l_File, "[string Whence=\"cur\", number Offset=0]", int o = 0; CFILE *cfp = NULL; - if(!ade_get_args(L, "o|si", l_File.Get(&cfp), &w, &o)) + if(!ade_get_args(L, "o|si", l_File.Get(&cfp), &w, &o)) //-V510 return ADE_RETURN_NIL; if(!cf_is_valid(cfp)) @@ -1205,7 +1205,7 @@ ADE_FUNC(write, l_File, "string or number, ...", "Writes a series of Lua strings or numbers to the current file.", "number", "Number of items successfully written.") { CFILE *cfp = NULL; - if(!ade_get_args(L, "o", l_File.Get(&cfp))) + if(!ade_get_args(L, "o", l_File.Get(&cfp))) //-V510 return ade_set_error(L, "i", 0); if(!cf_is_valid(cfp)) @@ -1244,7 +1244,7 @@ ade_obj l_Font("font", "font handle"); ADE_FUNC(__tostring, l_Font, NULL, "Filename of font", "string", "Font filename, or an empty string if the handle is invalid") { int font = -1; - if(!ade_get_args(L, "o", l_Font.Get(&font))) + if(!ade_get_args(L, "o", l_Font.Get(&font))) //-V510 return ade_set_error(L, "s", ""); if(font < 0 || font >= Num_fonts) @@ -1257,7 +1257,7 @@ ADE_VIRTVAR(Filename, l_Font, "string", "Filename of font (including extension)" { int font = -1; char *newname = NULL; - if(!ade_get_args(L, "o|s", l_Font.Get(&font), &newname)) + if(!ade_get_args(L, "o|s", l_Font.Get(&font), &newname)) //-V510 return ade_set_error(L, "s", ""); if(font < 0 || font >= Num_fonts) @@ -1274,7 +1274,7 @@ ADE_VIRTVAR(Height, l_Font, "number", "Height of font (in pixels)", "number", "F { int font = -1; int newheight = -1; - if(!ade_get_args(L, "o|i", l_Font.Get(&font), &newheight)) + if(!ade_get_args(L, "o|i", l_Font.Get(&font), &newheight)) //-V510 return ade_set_error(L, "i", 0); if(font < 0 || font >= Num_fonts) @@ -1290,7 +1290,7 @@ ADE_VIRTVAR(Height, l_Font, "number", "Height of font (in pixels)", "number", "F ADE_FUNC(isValid, l_Font, NULL, "True if valid, false or nil if not", "boolean", "Detects whether handle is valid") { int font; - if(!ade_get_args(L, "o", l_Font.Get(&font))) + if(!ade_get_args(L, "o", l_Font.Get(&font))) //-V510 return ADE_RETURN_NIL; if(font < 0 || font >= Num_fonts) @@ -1318,7 +1318,7 @@ ade_obj l_GameEvent("gameevent", "Game event"); ADE_FUNC(__tostring, l_GameEvent, NULL, "Game event name", "string", "Game event name, or empty string if handle is invalid") { gameevent_h *gh = NULL; - if(!ade_get_args(L, "o", l_GameEvent.GetPtr(&gh))) + if(!ade_get_args(L, "o", l_GameEvent.GetPtr(&gh))) //-V510 return ade_set_error(L, "s", ""); if(!gh->IsValid()) @@ -1331,7 +1331,7 @@ ADE_VIRTVAR(Name, l_GameEvent, "string", "Game event name", "string", "Game even { gameevent_h *gh = NULL; char *n_name = NULL; - if(!ade_get_args(L, "o|s", l_GameEvent.GetPtr(&gh), &n_name)) + if(!ade_get_args(L, "o|s", l_GameEvent.GetPtr(&gh), &n_name)) //-V510 return ade_set_error(L, "s", ""); if(!gh->IsValid()) @@ -1366,7 +1366,7 @@ ade_obj l_GameState("gamestate", "Game state"); ADE_FUNC(__tostring, l_GameState, NULL, "Game state name", "string", "Game state name, or empty string if handle is invalid") { gamestate_h *gh = NULL; - if(!ade_get_args(L, "o", l_GameState.GetPtr(&gh))) + if(!ade_get_args(L, "o", l_GameState.GetPtr(&gh))) //-V510 return ade_set_error(L, "s", ""); if(!gh->IsValid()) @@ -1379,7 +1379,7 @@ ADE_VIRTVAR(Name, l_GameState,"string", "Game state name", "string", "Game state { gamestate_h *gh = NULL; char *n_name = NULL; - if(!ade_get_args(L, "o|s", l_GameState.GetPtr(&gh), &n_name)) + if(!ade_get_args(L, "o|s", l_GameState.GetPtr(&gh), &n_name)) //-V510 return ade_set_error(L, "s", ""); if(!gh->IsValid()) @@ -1402,7 +1402,7 @@ ADE_VIRTVAR(Name, l_HudGauge, "string", "Custom HUD Gauge name", "string", "Cust { HudGauge* gauge; - if (!ade_get_args(L, "o", l_HudGauge.GetPtr(&gauge))) + if (!ade_get_args(L, "o", l_HudGauge.GetPtr(&gauge))) //-V510 return ADE_RETURN_NIL; if (gauge->getConfigType() != HUD_OBJECT_CUSTOM) @@ -1416,7 +1416,7 @@ ADE_VIRTVAR(Text, l_HudGauge, "string", "Custom HUD Gauge text", "string", "Cust HudGauge* gauge; char* text = NULL; - if (!ade_get_args(L, "o|s", l_HudGauge.GetPtr(&gauge), text)) + if (!ade_get_args(L, "o|s", l_HudGauge.GetPtr(&gauge), text)) //-V510 return ADE_RETURN_NIL; if (gauge->getConfigType() != HUD_OBJECT_CUSTOM) @@ -1563,37 +1563,37 @@ ADE_VIRTVAR(Textures, l_Model, "modeltextures", "Model textures", "modeltextures { model_h *mdl = NULL; modeltextures_h *oth = NULL; - if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_ModelTextures.GetPtr(&oth))) - return ade_set_error(L, "o", l_ModelTextures.Set(modeltextures_h())); + if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_ModelTextures.GetPtr(&oth))) //-V510 + return ade_set_error(L, "o", l_ModelTextures.Set(modeltextures_h())); //-V510 polymodel *pm = mdl->Get(); if(pm == NULL) - return ade_set_error(L, "o", l_ModelTextures.Set(modeltextures_h())); + return ade_set_error(L, "o", l_ModelTextures.Set(modeltextures_h())); //-V510 if(ADE_SETTING_VAR && oth->IsValid()) { //WMC TODO: Copy code LuaError(L, "Attempt to use Incomplete Feature: Modeltextures copy"); } - return ade_set_args(L, "o", l_ModelTextures.Set(modeltextures_h(pm))); + return ade_set_args(L, "o", l_ModelTextures.Set(modeltextures_h(pm))); //-V510 } ADE_VIRTVAR(Thrusters, l_Model, "thrusters", "Model thrusters", "thrusters", "Thrusters of the model or invalid handle") { model_h *mdl = NULL; thrusters_h *oth = NULL; - if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Thrusters.GetPtr(&oth))) - return ade_set_error(L, "o", l_Thrusters.Set(thrusters_h())); + if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Thrusters.GetPtr(&oth))) //-V510 + return ade_set_error(L, "o", l_Thrusters.Set(thrusters_h())); //-V510 polymodel *pm = mdl->Get(); if(pm == NULL) - return ade_set_error(L, "o", l_Thrusters.Set(thrusters_h())); + return ade_set_error(L, "o", l_Thrusters.Set(thrusters_h())); //-V510 if(ADE_SETTING_VAR && oth->IsValid()) { LuaError(L, "Attempt to use Incomplete Feature: Thrusters copy"); } - return ade_set_args(L, "o", l_Thrusters.Set(thrusters_h(pm))); + return ade_set_args(L, "o", l_Thrusters.Set(thrusters_h(pm))); //-V510 } extern void model_calc_bound_box( vec3d *box, vec3d *big_mn, vec3d *big_mx); @@ -1602,13 +1602,13 @@ ADE_VIRTVAR(BoundingBoxMax, l_Model, "vector", "Model bounding box maximum", "ve { model_h *mdl = NULL; vec3d *v = NULL; - if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 polymodel *pm = mdl->Get(); if(pm == NULL) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v != NULL) { pm->maxs = *v; @@ -1617,20 +1617,20 @@ ADE_VIRTVAR(BoundingBoxMax, l_Model, "vector", "Model bounding box maximum", "ve model_calc_bound_box(pm->bounding_box, &pm->mins, &pm->maxs); } - return ade_set_args(L, "o", l_Vector.Set(pm->maxs)); + return ade_set_args(L, "o", l_Vector.Set(pm->maxs)); //-V510 } ADE_VIRTVAR(BoundingBoxMin, l_Model, "vector", "Model bounding box minimum", "vector", "Model bounding box, or an empty vector if the handle is invalid") { model_h *mdl = NULL; vec3d *v = NULL; - if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 polymodel *pm = mdl->Get(); if(pm == NULL) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v != NULL) { pm->mins = *v; @@ -1639,14 +1639,14 @@ ADE_VIRTVAR(BoundingBoxMin, l_Model, "vector", "Model bounding box minimum", "ve model_calc_bound_box(pm->bounding_box, &pm->mins, &pm->maxs); } - return ade_set_args(L, "o", l_Vector.Set(pm->mins)); + return ade_set_args(L, "o", l_Vector.Set(pm->mins)); //-V510 } ADE_VIRTVAR(Filename, l_Model, "string", "Model filename", "string", "Model filename, or an empty string if the handle is invalid") { model_h *mdl = NULL; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Model.GetPtr(&mdl), &s)) + if(!ade_get_args(L, "o|s", l_Model.GetPtr(&mdl), &s)) //-V510 return ade_set_error(L, "s", ""); polymodel *pm = mdl->Get(); @@ -1665,7 +1665,7 @@ ADE_VIRTVAR(Mass, l_Model, "number", "Model mass", "number", "Model mass, or 0 i { model_h *mdl = NULL; float nm = 0.0f; - if(!ade_get_args(L, "o|f", l_Model.GetPtr(&mdl), &nm)) + if(!ade_get_args(L, "o|f", l_Model.GetPtr(&mdl), &nm)) //-V510 return ade_set_error(L, "f", 0.0f); polymodel *pm = mdl->Get(); @@ -1684,27 +1684,27 @@ ADE_VIRTVAR(MomentOfInertia, l_Model, "orientation", "Model moment of inertia", { model_h *mdl = NULL; matrix_h *mh = NULL; - if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Matrix.GetPtr(&mh))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "o|o", l_Model.GetPtr(&mdl), l_Matrix.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 polymodel *pm = mdl->Get(); if(pm == NULL) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 if(ADE_SETTING_VAR && mh != NULL) { matrix *mtx = mh->GetMatrix(); memcpy(&pm->moment_of_inertia, mtx, sizeof(*mtx)); } - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&pm->moment_of_inertia))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&pm->moment_of_inertia))); //-V510 } ADE_VIRTVAR(Radius, l_Model, "number", "Model radius (Used for collision & culling detection)", "number", "Model Radius or 0 if invalid") { model_h *mdl = NULL; float nr = 0.0f; - if(!ade_get_args(L, "o|f", l_Model.GetPtr(&mdl), &nr)) + if(!ade_get_args(L, "o|f", l_Model.GetPtr(&mdl), &nr)) //-V510 return ade_set_error(L, "f", 0.0f); polymodel *pm = mdl->Get(); @@ -1722,7 +1722,7 @@ ADE_VIRTVAR(Radius, l_Model, "number", "Model radius (Used for collision & culli ADE_FUNC(isValid, l_Model, NULL, "True if valid, false or nil if not", "boolean", "Detects whether handle is valid") { model_h *mdl; - if(!ade_get_args(L, "o", l_Model.GetPtr(&mdl))) + if(!ade_get_args(L, "o", l_Model.GetPtr(&mdl))) //-V510 return ADE_RETURN_NIL; return mdl->IsValid(); @@ -1732,7 +1732,7 @@ ADE_FUNC(isValid, l_Model, NULL, "True if valid, false or nil if not", "boolean" ADE_FUNC(__len, l_Thrusters, NULL, "Number of thruster banks on the model", "number", "Number of thrusterbanks") { thrusters_h *trh; - if(!ade_get_args(L, "o", l_Thrusters.GetPtr(&trh))) + if(!ade_get_args(L, "o", l_Thrusters.GetPtr(&trh))) //-V510 return ade_set_error(L, "i", -1); if(!trh->IsValid()) @@ -1752,19 +1752,19 @@ ADE_INDEXER(l_Thrusters, "number Index", "Array of all thrusterbanks on this thr char *s = NULL; thrusterbank_h newThr = NULL; - if (!ade_get_args(L, "os|o", l_Thrusters.GetPtr(&trh), &s, l_Thrusterbank.Get(&newThr))) - return ade_set_error(L, "o", l_Thrusterbank.Set(thrusterbank_h())); + if (!ade_get_args(L, "os|o", l_Thrusters.GetPtr(&trh), &s, l_Thrusterbank.Get(&newThr))) //-V510 + return ade_set_error(L, "o", l_Thrusterbank.Set(thrusterbank_h())); //-V510 polymodel *pm = trh->Get(); if (!trh->IsValid() || s == NULL || pm == NULL) - return ade_set_error(L, "o", l_Thrusterbank.Set(thrusterbank_h())); + return ade_set_error(L, "o", l_Thrusterbank.Set(thrusterbank_h())); //-V510 //Determine index int idx = atoi(s) - 1; //Lua->FS2 if (idx < 0 || idx >= pm->n_thrusters) - return ade_set_error(L, "o", l_Thrusterbank.Set(thrusterbank_h())); + return ade_set_error(L, "o", l_Thrusterbank.Set(thrusterbank_h())); //-V510 thruster_bank* bank = &pm->thrusters[idx]; @@ -1776,13 +1776,13 @@ ADE_INDEXER(l_Thrusters, "number Index", "Array of all thrusterbanks on this thr } } - return ade_set_args(L, "o", l_Thrusterbank.Set(bank)); + return ade_set_args(L, "o", l_Thrusterbank.Set(bank)); //-V510 } ADE_FUNC(isValid, l_Thrusters, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { thrusters_h *trh; - if(!ade_get_args(L, "o", l_Thrusters.GetPtr(&trh))) + if(!ade_get_args(L, "o", l_Thrusters.GetPtr(&trh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", trh->IsValid()); @@ -1792,7 +1792,7 @@ ADE_FUNC(isValid, l_Thrusters, NULL, "Detects whether handle is valid", "boolean ADE_FUNC(__len, l_Thrusterbank, NULL, "Number of thrusters on this thrusterbank", "number", "Number of thrusters on this bank or 0 if handle is invalid") { thrusterbank_h *tbh = NULL; - if(!ade_get_args(L, "o", l_Thrusterbank.GetPtr(&tbh))) + if(!ade_get_args(L, "o", l_Thrusterbank.GetPtr(&tbh))) //-V510 return ade_set_error(L, "i", -1); if(!tbh->isValid()) @@ -1809,11 +1809,11 @@ ADE_INDEXER(l_Thrusterbank, "number Index", "Array of glowpoint", "glowpoint", " char *s = NULL; glowpoint_h *glh = NULL; - if (!ade_get_args(L, "os|o", l_Thrusterbank.GetPtr(&tbh), &s, l_Glowpoint.GetPtr(&glh))) - return ade_set_error(L, "o", l_Glowpoint.Set(glowpoint_h())); + if (!ade_get_args(L, "os|o", l_Thrusterbank.GetPtr(&tbh), &s, l_Glowpoint.GetPtr(&glh))) //-V510 + return ade_set_error(L, "o", l_Glowpoint.Set(glowpoint_h())); //-V510 if (!tbh->isValid() || s==NULL) - return ade_set_error(L, "o", l_Glowpoint.Set(glowpoint_h())); + return ade_set_error(L, "o", l_Glowpoint.Set(glowpoint_h())); //-V510 thruster_bank* bank = tbh->Get(); @@ -1821,7 +1821,7 @@ ADE_INDEXER(l_Thrusterbank, "number Index", "Array of glowpoint", "glowpoint", " int idx = atoi(s) - 1; //Lua->FS2 if (idx < 0 || idx >= bank->num_points) - return ade_set_error(L, "o", l_Glowpoint.Set(glowpoint_h())); + return ade_set_error(L, "o", l_Glowpoint.Set(glowpoint_h())); //-V510 glow_point* glp = &bank->points[idx]; @@ -1833,13 +1833,13 @@ ADE_INDEXER(l_Thrusterbank, "number Index", "Array of glowpoint", "glowpoint", " } } - return ade_set_args(L, "o", l_Glowpoint.Set(glp)); + return ade_set_args(L, "o", l_Glowpoint.Set(glp)); //-V510 } ADE_FUNC(isValid, l_Thrusterbank, NULL, "Detectes if this handle is valid", "boolean", "true if this handle is valid, false otherwise") { thrusterbank_h* trh; - if(!ade_get_args(L, "o", l_Thrusterbank.GetPtr(&trh))) + if(!ade_get_args(L, "o", l_Thrusterbank.GetPtr(&trh))) //-V510 return ADE_RETURN_FALSE; if (!trh->isValid()) @@ -1854,7 +1854,7 @@ ADE_VIRTVAR(Position, l_Glowpoint, NULL, "The (local) vector to the position of glowpoint_h *glh = NULL; vec3d newVec; - if(!ade_get_args(L, "o|o", l_Glowpoint.GetPtr(&glh), l_Vector.Get(&newVec))) + if(!ade_get_args(L, "o|o", l_Glowpoint.GetPtr(&glh), l_Vector.Get(&newVec))) //-V510 return ADE_RETURN_NIL; if (!glh->isValid()) @@ -1867,7 +1867,7 @@ ADE_VIRTVAR(Position, l_Glowpoint, NULL, "The (local) vector to the position of glh->point->pnt = newVec; } - return ade_set_args(L, "o", l_Vector.Set(vec)); + return ade_set_args(L, "o", l_Vector.Set(vec)); //-V510 } ADE_VIRTVAR(Radius, l_Glowpoint, NULL, "The radius of the glowpoint", "number", "The radius of the glowpoint or -1 of invalid") @@ -1875,7 +1875,7 @@ ADE_VIRTVAR(Radius, l_Glowpoint, NULL, "The radius of the glowpoint", "number", glowpoint_h* glh = NULL; float newVal; - if(!ade_get_args(L, "o|f", l_Glowpoint.GetPtr(&glh), &newVal)) + if(!ade_get_args(L, "o|f", l_Glowpoint.GetPtr(&glh), &newVal)) //-V510 return ade_set_error(L, "f", -1.0f); if (!glh->isValid()) @@ -1895,7 +1895,7 @@ ADE_FUNC(isValid, l_Glowpoint, NULL, "Returns wether this handle is valid or not { glowpoint_h glh = NULL; - if(!ade_get_args(L, "o", l_Glowpoint.Get(&glh))) + if(!ade_get_args(L, "o", l_Glowpoint.Get(&glh))) //-V510 return ADE_RETURN_FALSE; return ade_set_args(L, "b", glh.isValid()); @@ -1940,7 +1940,7 @@ ade_obj l_Order("order", "order handle"); ADE_FUNC(remove, l_Order, NULL, "Removes the given order from the ship's priority queue.", "boolean", "True if order was successfully removed, otherwise false or nil.") { order_h *ohp = NULL; - if(!ade_get_args(L, "o", l_Order.GetPtr(&ohp))) + if(!ade_get_args(L, "o", l_Order.GetPtr(&ohp))) //-V510 return ADE_RETURN_NIL; if(!ohp->IsValid()) @@ -1959,7 +1959,7 @@ ade_obj l_ShipOrders("shiporders", "Ship orders"); ADE_FUNC(__len, l_ShipOrders, NULL, "Number of textures on ship", "number", "Number of textures on ship, or 0 if handle is invalid") { object_h *objh = NULL; - if(!ade_get_args(L, "o", l_ShipOrders.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_ShipOrders.GetPtr(&objh))) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid() || objh->objp->type != OBJ_SHIP || Ships[objh->objp->instance].ai_index < 0) @@ -1975,11 +1975,11 @@ ADE_INDEXER(l_ShipOrders, "number Index/string TextureFilename", "Array of ship order_h *oh = NULL; int i; - if (!ade_get_args(L, "os|o", l_ShipOrders.GetPtr(&objh), &s, l_Order.GetPtr(&oh))) - return ade_set_error(L, "o", l_Order.Set(order_h())); + if (!ade_get_args(L, "os|o", l_ShipOrders.GetPtr(&objh), &s, l_Order.GetPtr(&oh))) //-V510 + return ade_set_error(L, "o", l_Order.Set(order_h())); //-V510 if (!objh->IsValid() || s==NULL) - return ade_set_error(L, "o", l_Order.Set(order_h())); + return ade_set_error(L, "o", l_Order.Set(order_h())); //-V510 ai_info *aip = &Ai_info[Ships[objh->objp->instance].ai_index]; @@ -1987,7 +1987,7 @@ ADE_INDEXER(l_ShipOrders, "number Index/string TextureFilename", "Array of ship int idx = atoi(s) - 1; //Lua->FS2 if (idx < 0 || idx >= MAX_AI_GOALS) - return ade_set_error(L, "o", l_Order.Set(order_h())); + return ade_set_error(L, "o", l_Order.Set(order_h())); //-V510 int num = 0; for(i = 0; i < MAX_AI_GOALS; i++) @@ -2002,7 +2002,7 @@ ADE_INDEXER(l_ShipOrders, "number Index/string TextureFilename", "Array of ship } if(i >= MAX_AI_GOALS) - return ade_set_error(L, "o", l_Order.Set(order_h())); + return ade_set_error(L, "o", l_Order.Set(order_h())); //-V510 if (ADE_SETTING_VAR) { @@ -2016,13 +2016,13 @@ ADE_INDEXER(l_ShipOrders, "number Index/string TextureFilename", "Array of ship } } - return ade_set_args(L, "o", l_Order.Set(order_h(objh->objp, i))); + return ade_set_args(L, "o", l_Order.Set(order_h(objh->objp, i))); //-V510 } ADE_FUNC(isValid, l_ShipOrders, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { object_h *oh; - if(!ade_get_args(L, "o", l_ShipOrders.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_ShipOrders.GetPtr(&oh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", oh->IsValid()); @@ -2057,7 +2057,7 @@ ADE_VIRTVAR(AfterburnerAccelerationTime, l_Physics, "number", "Afterburner accel { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2074,24 +2074,24 @@ ADE_VIRTVAR(AfterburnerVelocityMax, l_Physics, "vector", "Afterburner max veloci { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->afterburner_max_vel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->afterburner_max_vel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->afterburner_max_vel)); //-V510 } ADE_VIRTVAR(BankingConstant, l_Physics, "number", "Banking constant", "number", "Banking constant, or 0 if handle is invalid") { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2108,7 +2108,7 @@ ADE_VIRTVAR(ForwardAccelerationTime, l_Physics, "number", "Forward acceleration { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2125,7 +2125,7 @@ ADE_VIRTVAR(ForwardDecelerationTime, l_Physics, "number", "Forward deceleration { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2142,7 +2142,7 @@ ADE_VIRTVAR(ForwardThrust, l_Physics, "number", "Forward thrust amount (0-1), us { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2159,7 +2159,7 @@ ADE_VIRTVAR(Mass, l_Physics, "number", "Object mass", "number", "Object mass, or { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2176,24 +2176,24 @@ ADE_VIRTVAR(RotationalVelocity, l_Physics, "vector", "Rotational velocity (Local { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->rotvel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->rotvel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->rotvel)); //-V510 } ADE_VIRTVAR(RotationalVelocityDamping, l_Physics, "number", "Rotational damping, ie derivative of rotational speed", "number", "Rotational damping, or 0 if handle is invalid") { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2210,41 +2210,41 @@ ADE_VIRTVAR(RotationalVelocityDesired, l_Physics, "lvector", "Desired rotational { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->desired_rotvel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->desired_rotvel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->desired_rotvel)); //-V510 } ADE_VIRTVAR(RotationalVelocityMax, l_Physics, "vector", "Maximum rotational velocity (Local vector)", "vector", "Maximum rotational velocity, or null vector if handle is invalid") { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->max_rotvel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->max_rotvel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->max_rotvel)); //-V510 } ADE_VIRTVAR(ShockwaveShakeAmplitude, l_Physics, "number", "How much shaking from shockwaves is applied to object", "number", "Shockwave shake amplitude, or 0 if handle is invalid") { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2261,7 +2261,7 @@ ADE_VIRTVAR(SideThrust, l_Physics, "number", "Side thrust amount (0-1), used pri { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2278,7 +2278,7 @@ ADE_VIRTVAR(SlideAccelerationTime, l_Physics, "number", "Time to accelerate to m { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2295,7 +2295,7 @@ ADE_VIRTVAR(SlideDecelerationTime, l_Physics, "number", "Time to decelerate from { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2312,58 +2312,58 @@ ADE_VIRTVAR(Velocity, l_Physics, "vector", "Object world velocity (World vector) { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->vel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->vel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->vel)); //-V510 } ADE_VIRTVAR(VelocityDesired, l_Physics, "vector", "Desired velocity (World vector)", "vector", "Desired velocity, or null vector if handle is invalid") { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->desired_vel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->desired_vel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->desired_vel)); //-V510 } ADE_VIRTVAR(VelocityMax, l_Physics, "vector", "Object max local velocity (Local vector)", "vector", "Maximum velocity, or null vector if handle is invalid") { physics_info_h *pih; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Physics.GetPtr(&pih), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!pih->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { pih->pi->max_vel = *v3; } - return ade_set_args(L, "o", l_Vector.Set(pih->pi->max_vel)); + return ade_set_args(L, "o", l_Vector.Set(pih->pi->max_vel)); //-V510 } ADE_VIRTVAR(VerticalThrust, l_Physics, "number", "Vertical thrust amount (0-1), used primarily for thruster graphics", "number", "Vertical thrust amount, or 0 if handle is invalid") { physics_info_h *pih; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) + if(!ade_get_args(L, "o|f", l_Physics.GetPtr(&pih), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2381,7 +2381,7 @@ ADE_VIRTVAR(AfterburnerActive, l_Physics, "boolean", "Specifies if the afterburn physics_info_h *pih; bool set = false; - if(!ade_get_args(L, "o|b", l_Physics.GetPtr(&pih), &set)) + if(!ade_get_args(L, "o|b", l_Physics.GetPtr(&pih), &set)) //-V510 return ade_set_error(L, "b", false); if(!pih->IsValid()) @@ -2404,7 +2404,7 @@ ADE_VIRTVAR(AfterburnerActive, l_Physics, "boolean", "Specifies if the afterburn ADE_FUNC(isValid, l_Physics, NULL, "True if valid, false or nil if not", "boolean", "Detects whether handle is valid") { physics_info_h *pih; - if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) + if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", pih->IsValid()); @@ -2413,7 +2413,7 @@ ADE_FUNC(isValid, l_Physics, NULL, "True if valid, false or nil if not", "boolea ADE_FUNC(getSpeed, l_Physics, NULL, "Gets total speed as of last frame", "number", "Total speed, or 0 if handle is invalid") { physics_info_h *pih; - if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) + if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2425,7 +2425,7 @@ ADE_FUNC(getSpeed, l_Physics, NULL, "Gets total speed as of last frame", "number ADE_FUNC(getForwardSpeed, l_Physics, NULL, "Gets total speed in the ship's 'forward' direction as of last frame", "number", "Total forward speed, or 0 if handle is invalid") { physics_info_h *pih; - if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) + if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) //-V510 return ade_set_error(L, "f", 0.0f); if(!pih->IsValid()) @@ -2438,7 +2438,7 @@ ADE_FUNC(getForwardSpeed, l_Physics, NULL, "Gets total speed in the ship's 'forw ADE_FUNC(isAfterburnerActive, l_Physics, NULL, "True if Afterburners are on, false or nil if not", "boolean", "Detects whether afterburner is active") { physics_info_h *pih; - if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) + if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) //-V510 return ADE_RETURN_NIL; if(!pih->IsValid()) @@ -2454,7 +2454,7 @@ ADE_FUNC(isAfterburnerActive, l_Physics, NULL, "True if Afterburners are on, fal ADE_FUNC(isGliding, l_Physics, NULL, "True if glide mode is on, false or nil if not", "boolean", "Detects if ship is gliding") { physics_info_h *pih; - if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) + if(!ade_get_args(L, "o", l_Physics.GetPtr(&pih))) //-V510 return ADE_RETURN_NIL; if(!pih->IsValid()) @@ -2487,11 +2487,11 @@ ADE_VIRTVAR(Persistence, l_SEXPVariable, "enumeration", "SEXP Variable persistan { sexpvar_h *svh = NULL; enum_h *type = NULL; - if(!ade_get_args(L, "o|o", l_SEXPVariable.GetPtr(&svh), l_Enum.GetPtr(&type))) - return ade_set_error(L, "o", l_Enum.Set(enum_h())); + if(!ade_get_args(L, "o|o", l_SEXPVariable.GetPtr(&svh), l_Enum.GetPtr(&type))) //-V510 + return ade_set_error(L, "o", l_Enum.Set(enum_h())); //-V510 if(!svh->IsValid()) - return ade_set_error(L, "o", l_Enum.Set(enum_h())); + return ade_set_error(L, "o", l_Enum.Set(enum_h())); //-V510 sexp_variable *sv = &Sexp_variables[svh->idx]; @@ -2522,18 +2522,18 @@ ADE_VIRTVAR(Persistence, l_SEXPVariable, "enumeration", "SEXP Variable persistan else ren.index = LE_SEXPVAR_NOT_PERSISTENT; - return ade_set_args(L, "o", l_Enum.Set(ren)); + return ade_set_args(L, "o", l_Enum.Set(ren)); //-V510 } ADE_VIRTVAR(Type, l_SEXPVariable, "enumeration", "SEXP Variable type, uses SEXPVAR_TYPE_* enumerations", "enumeration", "SEXPVAR_TYPE_* enumeration, or invalid numeration if handle is invalid") { sexpvar_h *svh = NULL; enum_h *type = NULL; - if(!ade_get_args(L, "o|o", l_SEXPVariable.GetPtr(&svh), l_Enum.GetPtr(&type))) - return ade_set_error(L, "o", l_Enum.Set(enum_h())); + if(!ade_get_args(L, "o|o", l_SEXPVariable.GetPtr(&svh), l_Enum.GetPtr(&type))) //-V510 + return ade_set_error(L, "o", l_Enum.Set(enum_h())); //-V510 if(!svh->IsValid()) - return ade_set_error(L, "o", l_Enum.Set(enum_h())); + return ade_set_error(L, "o", l_Enum.Set(enum_h())); //-V510 sexp_variable *sv = &Sexp_variables[svh->idx]; @@ -2557,7 +2557,7 @@ ADE_VIRTVAR(Type, l_SEXPVariable, "enumeration", "SEXP Variable type, uses SEXPV else if(sv->type & SEXP_VARIABLE_STRING) ren.index = LE_SEXPVAR_TYPE_STRING; - return ade_set_args(L, "o", l_Enum.Set(ren)); + return ade_set_args(L, "o", l_Enum.Set(ren)); //-V510 } ADE_VIRTVAR(Value, l_SEXPVariable, "number/string", "SEXP variable value", "string", "SEXP variable contents, or nil if the variable is of an invalid type or the handle is invalid") @@ -2569,7 +2569,7 @@ ADE_VIRTVAR(Value, l_SEXPVariable, "number/string", "SEXP variable value", "stri if(lua_type(L, 2) == LUA_TNUMBER) { int newnumber = 0; - if(!ade_get_args(L, "o|i", l_SEXPVariable.GetPtr(&svh), &newnumber)) + if(!ade_get_args(L, "o|i", l_SEXPVariable.GetPtr(&svh), &newnumber)) //-V510 return ADE_RETURN_NIL; sprintf(number_as_str, "%d", newnumber); @@ -2577,7 +2577,7 @@ ADE_VIRTVAR(Value, l_SEXPVariable, "number/string", "SEXP variable value", "stri } else { - if(!ade_get_args(L, "o|s", l_SEXPVariable.GetPtr(&svh), &newvalue)) + if(!ade_get_args(L, "o|s", l_SEXPVariable.GetPtr(&svh), &newvalue)) //-V510 return ADE_RETURN_NIL; } @@ -2602,7 +2602,7 @@ ADE_VIRTVAR(Value, l_SEXPVariable, "number/string", "SEXP variable value", "stri ADE_FUNC(__tostring, l_SEXPVariable, NULL, "Returns SEXP name", "string", "SEXP name, or empty string if handle is invalid") { sexpvar_h *svh = NULL; - if(!ade_get_args(L, "o", l_SEXPVariable.GetPtr(&svh))) + if(!ade_get_args(L, "o", l_SEXPVariable.GetPtr(&svh))) //-V510 return ade_set_error(L, "s", ""); if(!svh->IsValid()) @@ -2614,7 +2614,7 @@ ADE_FUNC(__tostring, l_SEXPVariable, NULL, "Returns SEXP name", "string", "SEXP ADE_FUNC(isValid, l_SEXPVariable, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { sexpvar_h *svh = NULL; - if(!ade_get_args(L, "o", l_SEXPVariable.GetPtr(&svh))) + if(!ade_get_args(L, "o", l_SEXPVariable.GetPtr(&svh))) //-V510 return ADE_RETURN_NIL; if(!svh->IsValid()) @@ -2626,7 +2626,7 @@ ADE_FUNC(isValid, l_SEXPVariable, NULL, "Detects whether handle is valid", "bool ADE_FUNC(delete, l_SEXPVariable, NULL, "Deletes a SEXP Variable", "boolean", "True if successful, false if the handle is invalid") { sexpvar_h *svh = NULL; - if(!ade_get_args(L, "o", l_SEXPVariable.GetPtr(&svh))) + if(!ade_get_args(L, "o", l_SEXPVariable.GetPtr(&svh))) //-V510 return ade_set_error(L, "b", false); if(!svh->IsValid()) @@ -2651,7 +2651,7 @@ ADE_INDEXER(l_Shields, "enumeration/number", "Gets or sets shield quadrant stren if(lua_isstring(L, 2)) { char *qd = NULL; - if(!ade_get_args(L, "os|f", l_Shields.GetPtr(&objh), &qd, &nval)) + if(!ade_get_args(L, "os|f", l_Shields.GetPtr(&objh), &qd, &nval)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -2669,7 +2669,7 @@ ADE_INDEXER(l_Shields, "enumeration/number", "Gets or sets shield quadrant stren return ade_set_error(L, "f", 0.0f); } else { enum_h *qd = NULL; - if(!ade_get_args(L, "oo|f", l_Shields.GetPtr(&objh), l_Enum.GetPtr(&qd), &nval)) + if(!ade_get_args(L, "oo|f", l_Shields.GetPtr(&objh), l_Enum.GetPtr(&qd), &nval)) //-V510 return 0; if(!objh->IsValid()) @@ -2722,7 +2722,7 @@ ADE_VIRTVAR(CombinedLeft, l_Shields, "number", "Total shield hitpoints left (for { object_h *objh; float nval = -1.0f; - if(!ade_get_args(L, "o|f", l_Shields.GetPtr(&objh), &nval)) + if(!ade_get_args(L, "o|f", l_Shields.GetPtr(&objh), &nval)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -2739,7 +2739,7 @@ ADE_VIRTVAR(CombinedMax, l_Shields, "number", "Maximum shield hitpoints (for all { object_h *objh; float nval = -1.0f; - if(!ade_get_args(L, "o|f", l_Shields.GetPtr(&objh), &nval)) + if(!ade_get_args(L, "o|f", l_Shields.GetPtr(&objh), &nval)) //-V510 return 0; if(!objh->IsValid()) @@ -2755,7 +2755,7 @@ ADE_VIRTVAR(CombinedMax, l_Shields, "number", "Maximum shield hitpoints (for all ADE_FUNC(isValid, l_Shields, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { object_h *oh; - if(!ade_get_args(L, "o", l_Shields.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_Shields.GetPtr(&oh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", oh->IsValid()); @@ -2772,7 +2772,7 @@ ADE_VIRTVAR(Name, l_Shiptype, "string", "Ship type name", "string", "Ship type n char *s = NULL; int idx; - if(!ade_get_args(L, "o|s", l_Shiptype.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shiptype.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > (int)Ship_types.size()) @@ -2788,7 +2788,7 @@ ADE_VIRTVAR(Name, l_Shiptype, "string", "Ship type name", "string", "Ship type n ADE_FUNC(isValid, l_Shiptype, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Shiptype.Get(&idx))) + if(!ade_get_args(L, "o", l_Shiptype.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= (int)Ship_types.size()) @@ -2808,7 +2808,7 @@ ADE_VIRTVAR(Name, l_Species, "string", "Species name", "string", "Species name, char *s = NULL; int idx; - if(!ade_get_args(L, "o|s", l_Species.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Species.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= (int)Species_info.size()) @@ -2824,7 +2824,7 @@ ADE_VIRTVAR(Name, l_Species, "string", "Species name", "string", "Species name, ADE_FUNC(isValid, l_Species, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Species.Get(&idx))) + if(!ade_get_args(L, "o", l_Species.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= (int)Species_info.size()) @@ -2839,7 +2839,7 @@ ade_obj l_Team("team", "Team handle"); ADE_FUNC(__eq, l_Team, "team, team", "Checks whether two teams are the same team", "boolean", "true if equal") { int t1, t2; - if(!ade_get_args(L, "oo", l_Team.Get(&t1), l_Team.Get(&t2))) + if(!ade_get_args(L, "oo", l_Team.Get(&t1), l_Team.Get(&t2))) //-V510 return ADE_RETURN_FALSE; return ade_set_args(L, "b", (t1 == t2)); @@ -2849,7 +2849,7 @@ ADE_VIRTVAR(Name, l_Team, "string", "Team name", "string", "Team name, or empty { int tdx=-1; char *s=NULL; - if(!ade_get_args(L, "o|s", l_Team.Get(&tdx), &s)) + if(!ade_get_args(L, "o|s", l_Team.Get(&tdx), &s)) //-V510 return ade_set_error(L, "s", ""); if(tdx < 0 || tdx > Num_iffs) @@ -2865,7 +2865,7 @@ ADE_VIRTVAR(Name, l_Team, "string", "Team name", "string", "Team name, or empty ADE_FUNC(getColor, l_Team, NULL, "Gets the IFF color of the specified Team", "number, number, number", "rgb color for the specified team or nil if invalid") { int idx; int r,g,b; - if(!ade_get_args(L, "o", l_Team.Get(&idx))) + if(!ade_get_args(L, "o", l_Team.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_iffs) @@ -2883,7 +2883,7 @@ ADE_FUNC(getColor, l_Team, NULL, "Gets the IFF color of the specified Team", "nu ADE_FUNC(isValid, l_Team, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Team.Get(&idx))) + if(!ade_get_args(L, "o", l_Team.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_iffs) @@ -2903,7 +2903,7 @@ ADE_FUNC(__gc, l_Texture, NULL, "Auto-deletes texture", NULL, NULL) { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx > -1 && bm_is_valid(idx)) @@ -2916,7 +2916,7 @@ ADE_FUNC(__eq, l_Texture, "texture, texture", "Checks if two texture handles ref { int idx,idx2; - if(!ade_get_args(L, "oo", l_Texture.Get(&idx), l_Texture.Get(&idx2))) + if(!ade_get_args(L, "oo", l_Texture.Get(&idx), l_Texture.Get(&idx2))) //-V510 return ADE_RETURN_NIL; if(idx == idx2) @@ -2935,11 +2935,11 @@ ADE_INDEXER(l_Texture, "number", int idx; int frame=-1; int newframe=-1; //WMC - Ignore for now - if(!ade_get_args(L, "oi|i", l_Texture.Get(&idx), &frame, &newframe)) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if(!ade_get_args(L, "oi|i", l_Texture.Get(&idx), &frame, &newframe)) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if(frame < 1) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 //Get me some info int num=-1; @@ -2948,20 +2948,20 @@ ADE_INDEXER(l_Texture, "number", //Check it's a valid one if(first < 0 || frame > num) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 frame--; //Lua->FS2 //Get actual texture handle frame = first + frame; - return ade_set_args(L, "o", l_Texture.Set(frame)); + return ade_set_args(L, "o", l_Texture.Set(frame)); //-V510 } ADE_FUNC(isValid, l_Texture, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", bm_is_valid(idx)); @@ -2971,7 +2971,7 @@ ADE_FUNC(unload, l_Texture, NULL, "Unloads a texture from memory", NULL, NULL) { int *idx; - if(!ade_get_args(L, "o", l_Texture.GetPtr(&idx))) + if(!ade_get_args(L, "o", l_Texture.GetPtr(&idx))) //-V510 return ADE_RETURN_NIL; if(!bm_is_valid(*idx)) @@ -2988,7 +2988,7 @@ ADE_FUNC(unload, l_Texture, NULL, "Unloads a texture from memory", NULL, NULL) ADE_FUNC(getFilename, l_Texture, NULL, "Returns filename for texture", "string", "Filename, or empty string if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ade_set_error(L, "s", ""); if(!bm_is_valid(idx)) @@ -3000,7 +3000,7 @@ ADE_FUNC(getFilename, l_Texture, NULL, "Returns filename for texture", "string", ADE_FUNC(getWidth, l_Texture, NULL, "Gets texture width", "number", "Texture width, or 0 if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ade_set_error(L, "i", 0); if(!bm_is_valid(idx)) @@ -3017,7 +3017,7 @@ ADE_FUNC(getWidth, l_Texture, NULL, "Gets texture width", "number", "Texture wid ADE_FUNC(getHeight, l_Texture, NULL, "Gets texture height", "number", "Texture height, or 0 if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ade_set_error(L, "i", 0); if(!bm_is_valid(idx)) @@ -3034,7 +3034,7 @@ ADE_FUNC(getHeight, l_Texture, NULL, "Gets texture height", "number", "Texture h ADE_FUNC(getFPS, l_Texture, NULL,"Gets frames-per-second of texture", "number", "Texture FPS, or 0 if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ade_set_error(L, "i", 0); if(!bm_is_valid(idx)) @@ -3051,7 +3051,7 @@ ADE_FUNC(getFPS, l_Texture, NULL,"Gets frames-per-second of texture", "number", ADE_FUNC(getFramesLeft, l_Texture, NULL, "Gets number of frames left, from handle's position in animation", "number", "Frames left, or 0 if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Texture.Get(&idx))) + if(!ade_get_args(L, "o", l_Texture.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(!bm_is_valid(idx)) @@ -3073,7 +3073,7 @@ ADE_INDEXER(l_Vector, "x,y,z or 1-3", "Vector component", "number", "Value at in vec3d *v3; char *s = NULL; float newval = 0.0f; - int numargs = ade_get_args(L, "os|f", l_Vector.GetPtr(&v3), &s, &newval); + int numargs = ade_get_args(L, "os|f", l_Vector.GetPtr(&v3), &s, &newval); //-V510 if(!numargs || s[1] != '\0') return ade_set_error(L, "f", 0.0f); @@ -3102,8 +3102,8 @@ ADE_FUNC(__add, l_Vector, "number/vector", "Adds vector by another vector, or ad if(lua_isnumber(L, 1) || lua_isnumber(L, 2)) { float f; - if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) - || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) + if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) //-V510 + || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) //-V510 { v3.xyz.x += f; v3.xyz.y += f; @@ -3114,12 +3114,12 @@ ADE_FUNC(__add, l_Vector, "number/vector", "Adds vector by another vector, or ad { vec3d v3b; //WMC - doesn't really matter which is which - if(ade_get_args(L, "oo", l_Vector.Get(&v3), l_Vector.Get(&v3b))) + if(ade_get_args(L, "oo", l_Vector.Get(&v3), l_Vector.Get(&v3b))) //-V510 { vm_vec_add2(&v3, &v3b); } } - return ade_set_args(L, "o", l_Vector.Set(v3)); + return ade_set_args(L, "o", l_Vector.Set(v3)); //-V510 } ADE_FUNC(__sub, l_Vector, "number/vector", "Subtracts vector from another vector, or subtracts all axes by value", "vector", "Final vector, or null vector if error occurs") @@ -3128,8 +3128,8 @@ ADE_FUNC(__sub, l_Vector, "number/vector", "Subtracts vector from another vector if(lua_isnumber(L, 1) || lua_isnumber(L, 2)) { float f; - if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) - || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) + if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) //-V510 + || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) //-V510 { v3.xyz.x += f; v3.xyz.y += f; @@ -3140,13 +3140,13 @@ ADE_FUNC(__sub, l_Vector, "number/vector", "Subtracts vector from another vector { vec3d v3b; //WMC - doesn't really matter which is which - if(ade_get_args(L, "oo", l_Vector.Get(&v3), l_Vector.Get(&v3b))) + if(ade_get_args(L, "oo", l_Vector.Get(&v3), l_Vector.Get(&v3b))) //-V510 { vm_vec_sub2(&v3, &v3b); } } - return ade_set_args(L, "o", l_Vector.Set(v3)); + return ade_set_args(L, "o", l_Vector.Set(v3)); //-V510 } ADE_FUNC(__mul, l_Vector, "number/vector", "Scales vector object (Multiplies all axes by number), or multiplies each axes by the other vector's axes.", "vector", "Final vector, or null vector if error occurs") @@ -3155,8 +3155,8 @@ ADE_FUNC(__mul, l_Vector, "number/vector", "Scales vector object (Multiplies all if(lua_isnumber(L, 1) || lua_isnumber(L, 2)) { float f; - if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) - || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) + if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) //-V510 + || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) //-V510 { vm_vec_scale(&v3, f); } @@ -3165,15 +3165,15 @@ ADE_FUNC(__mul, l_Vector, "number/vector", "Scales vector object (Multiplies all { vec3d *v1 = NULL; vec3d *v2 = NULL; - if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v1), l_Vector.GetPtr(&v2))) - return ade_set_args(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v1), l_Vector.GetPtr(&v2))) //-V510 + return ade_set_args(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 v3.xyz.x = v1->xyz.x * v2->xyz.x; v3.xyz.y = v1->xyz.y * v2->xyz.y; v3.xyz.z = v1->xyz.z * v2->xyz.z; } - return ade_set_args(L, "o", l_Vector.Set(v3)); + return ade_set_args(L, "o", l_Vector.Set(v3)); //-V510 } ADE_FUNC(__div, l_Vector, "number/vector", "Scales vector object (Divide all axes by number), or divides each axes by the dividing vector's axes.", "vector", "Final vector, or null vector if error occurs") @@ -3182,8 +3182,8 @@ ADE_FUNC(__div, l_Vector, "number/vector", "Scales vector object (Divide all axe if(lua_isnumber(L, 1) || lua_isnumber(L, 2)) { float f; - if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) - || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) + if(lua_isnumber(L, 1) && ade_get_args(L, "fo", &f, l_Vector.Get(&v3)) //-V510 + || lua_isnumber(L, 2) && ade_get_args(L, "of", l_Vector.Get(&v3), &f)) //-V510 { vm_vec_scale(&v3, 1.0f/f); } @@ -3192,22 +3192,22 @@ ADE_FUNC(__div, l_Vector, "number/vector", "Scales vector object (Divide all axe { vec3d *v1 = NULL; vec3d *v2 = NULL; - if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v1), l_Vector.GetPtr(&v2))) - return ade_set_args(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v1), l_Vector.GetPtr(&v2))) //-V510 + return ade_set_args(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 v3.xyz.x = v1->xyz.x / v2->xyz.x; v3.xyz.y = v1->xyz.y / v2->xyz.y; v3.xyz.z = v1->xyz.z / v2->xyz.z; } - return ade_set_args(L, "o", l_Vector.Set(v3)); + return ade_set_args(L, "o", l_Vector.Set(v3)); //-V510 } ADE_FUNC(__tostring, l_Vector, NULL, "Converts a vector to string with format \"(x,y,z)\"", "string", "Vector as string, or empty string if handle is invalid") { vec3d *v3; - if(!ade_get_args(L, "o", l_Vector.GetPtr(&v3))) + if(!ade_get_args(L, "o", l_Vector.GetPtr(&v3))) //-V510 return ade_set_error(L, "s", ""); char buf[128]; @@ -3222,8 +3222,8 @@ ADE_FUNC(getOrientation, l_Vector, NULL, "Orientation object, or null orientation object if handle is invalid") { vec3d v3; - if(!ade_get_args(L, "o", l_Vector.Get(&v3))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "o", l_Vector.Get(&v3))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 matrix mt = vmd_identity_matrix; @@ -3231,13 +3231,13 @@ ADE_FUNC(getOrientation, l_Vector, NULL, vm_vector_2_matrix_norm(&mt, &v3); matrix_h mh(&mt); - return ade_set_args(L, "o", l_Matrix.Set(mh)); + return ade_set_args(L, "o", l_Matrix.Set(mh)); //-V510 } ADE_FUNC(getMagnitude, l_Vector, NULL, "Returns the magnitude of a vector (Total regardless of direction)", "number", "Magnitude of vector, or 0 if handle is invalid") { vec3d *v3; - if(!ade_get_args(L, "o", l_Vector.GetPtr(&v3))) + if(!ade_get_args(L, "o", l_Vector.GetPtr(&v3))) //-V510 return ade_set_error(L, "f", 0.0f); return ade_set_args(L, "f", vm_vec_mag(v3)); @@ -3246,7 +3246,7 @@ ADE_FUNC(getMagnitude, l_Vector, NULL, "Returns the magnitude of a vector (Total ADE_FUNC(getDistance, l_Vector, "Vector", "Distance", "number", "Returns distance from another vector") { vec3d *v3a, *v3b; - if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b))) + if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b))) //-V510 return ade_set_error(L, "f", 0.0f); return ade_set_args(L, "f",vm_vec_dist(v3a, v3b)); @@ -3255,7 +3255,7 @@ ADE_FUNC(getDistance, l_Vector, "Vector", "Distance", "number", "Returns distanc ADE_FUNC(getDotProduct, l_Vector, "vector OtherVector", "Returns dot product of vector object with vector argument", "number", "Dot product, or 0 if a handle is invalid") { vec3d *v3a, *v3b; - if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b))) + if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b))) //-V510 return ade_set_error(L, "f", 0.0f); return ade_set_args(L, "f", vm_vec_dotprod(v3a, v3b)); @@ -3264,19 +3264,19 @@ ADE_FUNC(getDotProduct, l_Vector, "vector OtherVector", "Returns dot product of ADE_FUNC(getCrossProduct, l_Vector, "vector OtherVector", "Returns cross product of vector object with vector argument", "vector", "Cross product, or null vector if a handle is invalid") { vec3d *v3a, *v3b; - if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "oo", l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 vec3d v3r; vm_vec_crossprod(&v3r, v3a, v3b); - return ade_set_args(L, "o",l_Vector.Set(v3r)); + return ade_set_args(L, "o",l_Vector.Set(v3r)); //-V510 } ADE_FUNC(getScreenCoords, l_Vector, NULL, "Gets screen cordinates of a world vector", "number,number", "X (number), Y (number), or false if off-screen") { vec3d v3; - if(!ade_get_args(L, "o", l_Vector.Get(&v3))) + if(!ade_get_args(L, "o", l_Vector.Get(&v3))) //-V510 return ADE_RETURN_NIL; vertex vtx; @@ -3299,12 +3299,12 @@ ADE_FUNC(getScreenCoords, l_Vector, NULL, "Gets screen cordinates of a world vec ADE_FUNC(getNormalized, l_Vector, NULL, "Returns a normalized version of the vector", "vector", "Normalized Vector, or NIL if invalid") { vec3d v3; - if(!ade_get_args(L, "o", l_Vector.Get(&v3))) + if(!ade_get_args(L, "o", l_Vector.Get(&v3))) //-V510 return ADE_RETURN_NIL; vm_vec_normalize(&v3); - return ade_set_args(L, "o", l_Vector.Set(v3)); + return ade_set_args(L, "o", l_Vector.Set(v3)); //-V510 } //**********HANDLE: material @@ -3392,54 +3392,54 @@ ADE_VIRTVAR(BaseMap, l_TextureMap, "texture", "Base texture", "texture", "Base t { texture_map_h *tmh = NULL; int new_tex = -1; - if(!ade_get_args(L, "o|o", l_TextureMap.GetPtr(&tmh), l_Texture.Get(&new_tex))) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if(!ade_get_args(L, "o|o", l_TextureMap.GetPtr(&tmh), l_Texture.Get(&new_tex))) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 texture_map *tmap = tmh->Get(); if(tmap == NULL) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if(ADE_SETTING_VAR && new_tex > -1) { tmap->textures[TM_BASE_TYPE].SetTexture(new_tex); } - return ade_set_args(L, "o", l_Texture.Set(tmap->textures[TM_BASE_TYPE].GetTexture())); + return ade_set_args(L, "o", l_Texture.Set(tmap->textures[TM_BASE_TYPE].GetTexture())); //-V510 } ADE_VIRTVAR(GlowMap, l_TextureMap, "texture", "Glow texture", "texture", "Glow texture, or invalid texture handle if material handle is invalid") { texture_map_h *tmh = NULL; int new_tex = -1; - if(!ade_get_args(L, "o|o", l_TextureMap.GetPtr(&tmh), l_Texture.Get(&new_tex))) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if(!ade_get_args(L, "o|o", l_TextureMap.GetPtr(&tmh), l_Texture.Get(&new_tex))) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 texture_map *tmap = tmh->Get(); if(tmap == NULL) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if(ADE_SETTING_VAR && new_tex > -1) { tmap->textures[TM_GLOW_TYPE].SetTexture(new_tex); } - return ade_set_args(L, "o", l_Texture.Set(tmap->textures[TM_GLOW_TYPE].GetTexture())); + return ade_set_args(L, "o", l_Texture.Set(tmap->textures[TM_GLOW_TYPE].GetTexture())); //-V510 } ADE_VIRTVAR(SpecularMap, l_TextureMap, "texture", "Specular texture", "texture", "Texture handle, or invalid texture handle if material handle is invalid") { texture_map_h *tmh = NULL; int new_tex = -1; - if(!ade_get_args(L, "o|o", l_TextureMap.GetPtr(&tmh), l_Texture.Get(&new_tex))) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if(!ade_get_args(L, "o|o", l_TextureMap.GetPtr(&tmh), l_Texture.Get(&new_tex))) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 texture_map *tmap = tmh->Get(); if(tmap == NULL) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if(ADE_SETTING_VAR && new_tex > -1) { tmap->textures[TM_SPECULAR_TYPE].SetTexture(new_tex); } - return ade_set_args(L, "o", l_Texture.Set(tmap->textures[TM_SPECULAR_TYPE].GetTexture())); + return ade_set_args(L, "o", l_Texture.Set(tmap->textures[TM_SPECULAR_TYPE].GetTexture())); //-V510 } //**********HANDLE: Weaponclass @@ -3449,7 +3449,7 @@ ADE_FUNC(__tostring, l_Weaponclass, NULL, "Weapon class name", "string", "Weapon { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_weapon_types) @@ -3463,7 +3463,7 @@ ADE_VIRTVAR(Name, l_Weaponclass, "string", "Weapon class name", "string", "Weapo { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_weapon_types) @@ -3480,7 +3480,7 @@ ADE_VIRTVAR(Title, l_Weaponclass, "string", "Weapon class title", "string", "Wea { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_weapon_types) @@ -3497,7 +3497,7 @@ ADE_VIRTVAR(Description, l_Weaponclass, "string", "Weapon class description stri { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Num_weapon_types) @@ -3525,7 +3525,7 @@ ADE_VIRTVAR(TechTitle, l_Weaponclass, "string", "Weapon class tech title", "stri { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_weapon_types) @@ -3542,7 +3542,7 @@ ADE_VIRTVAR(TechAnimationFilename, l_Weaponclass, "string", "Weapon class animat { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_weapon_types) @@ -3559,7 +3559,7 @@ ADE_VIRTVAR(TechDescription, l_Weaponclass, "string", "Weapon class tech descrip { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Weaponclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Num_weapon_types) @@ -3587,11 +3587,11 @@ ADE_VIRTVAR(Model, l_Weaponclass, "model", "Model", "model", "Weapon class model { int weapon_info_idx=-1; model_h *mdl = NULL; - if(!ade_get_args(L, "o|o", l_Weaponclass.Get(&weapon_info_idx), l_Model.GetPtr(&mdl))) - return ade_set_error(L, "o", l_Model.Set(-1)); + if(!ade_get_args(L, "o|o", l_Weaponclass.Get(&weapon_info_idx), l_Model.GetPtr(&mdl))) //-V510 + return ade_set_error(L, "o", l_Model.Set(-1)); //-V510 if(weapon_info_idx < 0 || weapon_info_idx > Num_weapon_types) - return ade_set_error(L, "o", l_Model.Set(-1)); + return ade_set_error(L, "o", l_Model.Set(-1)); //-V510 weapon_info *wip = &Weapon_info[weapon_info_idx]; @@ -3601,14 +3601,14 @@ ADE_VIRTVAR(Model, l_Weaponclass, "model", "Model", "model", "Weapon class model wip->model_num = mid; } - return ade_set_args(L, "o", l_Model.Set(model_h(wip->model_num))); + return ade_set_args(L, "o", l_Model.Set(model_h(wip->model_num))); //-V510 } ADE_VIRTVAR(ArmorFactor, l_Weaponclass, "number", "Amount of weapon damage applied to ship hull (0-1.0)", "number", "Armor factor, or empty string if handle is invalid") { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3625,7 +3625,7 @@ ADE_VIRTVAR(Damage, l_Weaponclass, "number", "Amount of damage that weapon deals { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3642,7 +3642,7 @@ ADE_VIRTVAR(FireWait, l_Weaponclass, "number", "Weapon fire wait (cooldown time) { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3659,7 +3659,7 @@ ADE_VIRTVAR(FreeFlightTime, l_Weaponclass, "number", "The time the weapon will f { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3676,7 +3676,7 @@ ADE_VIRTVAR(LifeMax, l_Weaponclass, "number", "Life of weapon in seconds", "numb { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3693,7 +3693,7 @@ ADE_VIRTVAR(Range, l_Weaponclass, "number", "Range of weapon in meters", "number { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3710,7 +3710,7 @@ ADE_VIRTVAR(Mass, l_Weaponclass, "number", "Weapon mass", "number", "Weapon mass { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3727,7 +3727,7 @@ ADE_VIRTVAR(ShieldFactor, l_Weaponclass, "number", "Amount of weapon damage appl { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3744,7 +3744,7 @@ ADE_VIRTVAR(SubsystemFactor, l_Weaponclass, "number", "Amount of weapon damage a { int idx; float f = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3761,7 +3761,7 @@ ADE_VIRTVAR(TargetLOD, l_Weaponclass, "number", "LOD used for weapon model in th { int idx; int lod = 0; - if(!ade_get_args(L, "o|i", l_Weaponclass.Get(&idx), &lod)) + if(!ade_get_args(L, "o|i", l_Weaponclass.Get(&idx), &lod)) //-V510 return ade_set_error(L, "i", 0); if(idx < 0 || idx > Num_weapon_types) @@ -3778,7 +3778,7 @@ ADE_VIRTVAR(Speed, l_Weaponclass, "number", "Weapon max speed, aka $Velocity in { int idx; float spd = 0.0f; - if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &spd)) + if(!ade_get_args(L, "o|f", l_Weaponclass.Get(&idx), &spd)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_weapon_types) @@ -3795,7 +3795,7 @@ ADE_VIRTVAR(Bomb, l_Weaponclass, "boolean", "Is weapon clas flagged as bomb", "b { int idx; bool newVal = false; - if(!ade_get_args(L, "o|b", l_Weaponclass.Get(&idx), &newVal)) + if(!ade_get_args(L, "o|b", l_Weaponclass.Get(&idx), &newVal)) //-V510 return ADE_RETURN_FALSE; if(idx < 0 || idx > Num_weapon_types) @@ -3825,7 +3825,7 @@ ADE_VIRTVAR(Bomb, l_Weaponclass, "boolean", "Is weapon clas flagged as bomb", "b ADE_FUNC(isValid, l_Weaponclass, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_weapon_types) @@ -3837,7 +3837,7 @@ ADE_FUNC(isValid, l_Weaponclass, NULL, "Detects whether handle is valid", "boole ADE_FUNC(getWeaponClassIndex, l_Weaponclass, NULL, "Gets the index valus of the weapon class", "number", "index value of the weapon class") { int idx; - if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) //-V510 return ade_set_args(L, "i", -1); if(idx < 0 || idx >= Num_weapon_types) @@ -3849,7 +3849,7 @@ ADE_FUNC(getWeaponClassIndex, l_Weaponclass, NULL, "Gets the index valus of the ADE_FUNC(isLaser, l_Weaponclass, NULL, "Return true if the weapon is a laser (this includes balistic primaries)", "boolean", "true if the weapon is a laser, false otherwise") { int idx; - if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_weapon_types) @@ -3864,7 +3864,7 @@ ADE_FUNC(isLaser, l_Weaponclass, NULL, "Return true if the weapon is a laser (th ADE_FUNC(isMissile, l_Weaponclass, NULL, "Return true if the weapon is a missile", "boolean", "true if the weapon is a missile, false otherwise") { int idx; - if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_weapon_types) @@ -3879,7 +3879,7 @@ ADE_FUNC(isMissile, l_Weaponclass, NULL, "Return true if the weapon is a missile ADE_FUNC(isBeam, l_Weaponclass, NULL, "Return true if the weapon is a beam", "boolean", "true if the weapon is a beam, false otherwise") { int idx; - if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_weapon_types) @@ -3928,7 +3928,7 @@ ADE_FUNC(__gc, l_ColInfo, NULL, "Removes the allocated reference of this handle" { mc_info_h* info; - if(!ade_get_args(L, "o", l_ColInfo.GetPtr(&info))) + if(!ade_get_args(L, "o", l_ColInfo.GetPtr(&info))) //-V510 return ADE_RETURN_NIL; if (info->IsValid()) @@ -3942,11 +3942,11 @@ ADE_VIRTVAR(Model, l_ColInfo, "model", "The model this collision info is about", mc_info_h* info; model_h * mh; - if(!ade_get_args(L, "o|o", l_ColInfo.GetPtr(&info), l_Model.GetPtr(&mh))) - return ade_set_error(L, "o", l_Model.Set(model_h())); + if(!ade_get_args(L, "o|o", l_ColInfo.GetPtr(&info), l_Model.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Model.Set(model_h())); //-V510 if (!info->IsValid()) - return ade_set_error(L, "o", l_Model.Set(model_h())); + return ade_set_error(L, "o", l_Model.Set(model_h())); //-V510 mc_info *collide = info->Get(); @@ -3960,7 +3960,7 @@ ADE_VIRTVAR(Model, l_ColInfo, "model", "The model this collision info is about", } } - return ade_set_args(L, "o", l_Model.Set(model_h(modelNum))); + return ade_set_args(L, "o", l_Model.Set(model_h(modelNum))); //-V510 } ADE_FUNC(getCollisionPoint, l_ColInfo, "[boolean local]", "The collision point of this information (local to the object if boolean is set to true)", "vector", "The collision point or nil of none") @@ -3968,7 +3968,7 @@ ADE_FUNC(getCollisionPoint, l_ColInfo, "[boolean local]", "The collision point o mc_info_h* info; bool local = false; - if(!ade_get_args(L, "o|b", l_ColInfo.GetPtr(&info), &local)) + if(!ade_get_args(L, "o|b", l_ColInfo.GetPtr(&info), &local)) //-V510 return ADE_RETURN_NIL; if (!info->IsValid()) @@ -3983,9 +3983,9 @@ ADE_FUNC(getCollisionPoint, l_ColInfo, "[boolean local]", "The collision point o else { if (local) - return ade_set_args(L, "o", l_Vector.Set(collide->hit_point)); + return ade_set_args(L, "o", l_Vector.Set(collide->hit_point)); //-V510 else - return ade_set_args(L, "o", l_Vector.Set(collide->hit_point_world)); + return ade_set_args(L, "o", l_Vector.Set(collide->hit_point_world)); //-V510 } } @@ -3994,7 +3994,7 @@ ADE_FUNC(getCollisionNormal, l_ColInfo, "[boolean local]", "The collision normal mc_info_h* info; bool local = false; - if(!ade_get_args(L, "o|b", l_ColInfo.GetPtr(&info), &local)) + if(!ade_get_args(L, "o|b", l_ColInfo.GetPtr(&info), &local)) //-V510 return ADE_RETURN_NIL; if (!info->IsValid()) @@ -4014,11 +4014,11 @@ ADE_FUNC(getCollisionNormal, l_ColInfo, "[boolean local]", "The collision normal vm_vec_unrotate(&normal, &collide->hit_normal, collide->orient); - return ade_set_args(L, "o", l_Vector.Set(normal)); + return ade_set_args(L, "o", l_Vector.Set(normal)); //-V510 } else { - return ade_set_args(L, "o", l_Vector.Set(collide->hit_normal)); + return ade_set_args(L, "o", l_Vector.Set(collide->hit_normal)); //-V510 } } } @@ -4027,7 +4027,7 @@ ADE_FUNC(isValid, l_ColInfo, NULL, "Detectes if this handle is valid", "boolean" { mc_info_h* info; - if(!ade_get_args(L, "o", l_ColInfo.GetPtr(&info))) + if(!ade_get_args(L, "o", l_ColInfo.GetPtr(&info))) //-V510 return ADE_RETURN_NIL; if (info->IsValid()) @@ -4058,11 +4058,11 @@ ADE_VIRTVAR(Normal, l_Eyepoint, "vector", "Eyepoint normal", "vector", "Eyepoint { eye_h *eh; vec3d *v; - if(!ade_get_args(L, "o|o", l_Eyepoint.GetPtr(&eh), l_Vector.GetPtr(&v))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Eyepoint.GetPtr(&eh), l_Vector.GetPtr(&v))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!eh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 polymodel *pm = model_get(eh->model); @@ -4071,18 +4071,18 @@ ADE_VIRTVAR(Normal, l_Eyepoint, "vector", "Eyepoint normal", "vector", "Eyepoint pm->view_positions[eh->eye_idx].norm = *v; } - return ade_set_args(L, "o", l_Vector.Set(pm->view_positions[eh->eye_idx].norm)); + return ade_set_args(L, "o", l_Vector.Set(pm->view_positions[eh->eye_idx].norm)); //-V510 } ADE_VIRTVAR(Position, l_Eyepoint, "vector", "Eyepoint location (Local vector)", "vector", "Eyepoint location, or null vector if handle is invalid") { eye_h *eh; vec3d *v; - if(!ade_get_args(L, "o|o", l_Eyepoint.GetPtr(&eh), l_Vector.GetPtr(&v))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Eyepoint.GetPtr(&eh), l_Vector.GetPtr(&v))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!eh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 polymodel *pm = model_get(eh->model); @@ -4091,14 +4091,14 @@ ADE_VIRTVAR(Position, l_Eyepoint, "vector", "Eyepoint location (Local vector)", pm->view_positions[eh->eye_idx].pnt = *v; } - return ade_set_args(L, "o", l_Vector.Set(pm->view_positions[eh->eye_idx].pnt)); + return ade_set_args(L, "o", l_Vector.Set(pm->view_positions[eh->eye_idx].pnt)); //-V510 } //**********HANDLE: modeltextures ADE_FUNC(__len, l_ModelTextures, NULL, "Number of textures on model", "number", "Number of model textures") { modeltextures_h *mth; - if(!ade_get_args(L, "o", l_ModelTextures.GetPtr(&mth))) + if(!ade_get_args(L, "o", l_ModelTextures.GetPtr(&mth))) //-V510 return ade_set_error(L, "i", 0); if(!mth->IsValid()) @@ -4118,13 +4118,13 @@ ADE_INDEXER(l_ModelTextures, "texture", "number Index/string TextureName", "text int new_tex = -1; char *s = NULL; - if (!ade_get_args(L, "os|o", l_ModelTextures.GetPtr(&mth), &s, l_Texture.Get(&new_tex))) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if (!ade_get_args(L, "os|o", l_ModelTextures.GetPtr(&mth), &s, l_Texture.Get(&new_tex))) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 polymodel *pm = mth->Get(); if (!mth->IsValid() || s == NULL || pm == NULL) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 texture_info *tinfo = NULL; texture_map *tmap = NULL; @@ -4135,7 +4135,7 @@ ADE_INDEXER(l_ModelTextures, "texture", "number Index/string TextureName", "text int idx = atoi(s) - 1; //Lua->FS2 if (idx < 0 || idx >= num_textures) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 tmap = &pm->maps[idx / TM_NUM_TYPES]; tinfo = &tmap->textures[idx % TM_NUM_TYPES]; @@ -4154,19 +4154,19 @@ ADE_INDEXER(l_ModelTextures, "texture", "number Index/string TextureName", "text } if(tinfo == NULL) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if (ADE_SETTING_VAR) { tinfo->SetTexture(new_tex); } - return ade_set_args(L, "o", l_Texture.Set(tinfo->GetTexture())); + return ade_set_args(L, "o", l_Texture.Set(tinfo->GetTexture())); //-V510 } ADE_FUNC(isValid, l_ModelTextures, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { modeltextures_h *mth; - if(!ade_get_args(L, "o", l_ModelTextures.GetPtr(&mth))) + if(!ade_get_args(L, "o", l_ModelTextures.GetPtr(&mth))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", mth->IsValid()); @@ -4181,7 +4181,7 @@ ade_obj l_Object("object", "Object handle"); ADE_FUNC(__eq, l_Object, "object, object", "Checks whether two object handles are for the same object", "boolean", "True if equal, false if not or a handle is invalid") { object_h *o1, *o2; - if(!ade_get_args(L, "oo", l_Object.GetPtr(&o1), l_Object.GetPtr(&o2))) + if(!ade_get_args(L, "oo", l_Object.GetPtr(&o1), l_Object.GetPtr(&o2))) //-V510 return ADE_RETURN_FALSE; if(!o1->IsValid() || !o2->IsValid()) @@ -4193,7 +4193,7 @@ ADE_FUNC(__eq, l_Object, "object, object", "Checks whether two object handles ar ADE_FUNC(__tostring, l_Object, NULL, "Returns name of object (if any)", "string", "Object name, or empty string if handle is invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Object.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Object.GetPtr(&objh))) //-V510 return ade_set_error(L, "s", ""); if(!objh->IsValid()) @@ -4220,11 +4220,11 @@ ADE_VIRTVAR(Parent, l_Object, "object", "Parent of the object. Value may also be { object_h *objh; object_h *newparenth = NULL; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Object.GetPtr(&newparenth))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Object.GetPtr(&newparenth))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR) { @@ -4245,99 +4245,99 @@ ADE_VIRTVAR(Parent, l_Object, "object", "Parent of the object. Value may also be if(objh->objp->parent > -1) return ade_set_object_with_breed(L, objh->objp->parent); else - return ade_set_args(L, "o", l_Object.Set(object_h())); + return ade_set_args(L, "o", l_Object.Set(object_h())); //-V510 } ADE_VIRTVAR(Position, l_Object, "vector", "Object world position (World vector)", "vector", "World position, or null vector if handle is invalid") { object_h *objh; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { objh->objp->pos = *v3; } - return ade_set_args(L, "o", l_Vector.Set(objh->objp->pos)); + return ade_set_args(L, "o", l_Vector.Set(objh->objp->pos)); //-V510 } ADE_VIRTVAR(LastPosition, l_Object, "vector", "Object world position as of last frame (World vector)", "vector", "World position, or null vector if handle is invalid") { object_h *objh; vec3d *v3=NULL; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v3 != NULL) { objh->objp->last_pos = *v3; } - return ade_set_args(L, "o", l_Vector.Set(objh->objp->last_pos)); + return ade_set_args(L, "o", l_Vector.Set(objh->objp->last_pos)); //-V510 } ADE_VIRTVAR(Orientation, l_Object, "orientation", "Object world orientation (World orientation)", "orientation", "Orientation, or null orientation if handle is invalid") { object_h *objh; matrix_h *mh=NULL; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Matrix.GetPtr(&mh))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Matrix.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); + return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); //-V510 if(ADE_SETTING_VAR && mh != NULL) { objh->objp->orient = *mh->GetMatrix(); } - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&objh->objp->orient))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&objh->objp->orient))); //-V510 } ADE_VIRTVAR(LastOrientation, l_Object, "orientation", "Object world orientation as of last frame (World orientation)", "orientation", "Orientation, or null orientation if handle is invalid") { object_h *objh; matrix_h *mh=NULL; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Matrix.GetPtr(&mh))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Matrix.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); + return ade_set_error(L, "o", l_Matrix.Set(matrix_h(&vmd_identity_matrix))); //-V510 if(ADE_SETTING_VAR && mh != NULL) { objh->objp->last_orient = *mh->GetMatrix(); } - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&objh->objp->last_orient))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&objh->objp->last_orient))); //-V510 } ADE_VIRTVAR(Physics, l_Object, "physics", "Physics data used to move ship between frames", "physics", "Physics data, or invalid physics handle if object handle is invalid") { object_h *objh; physics_info_h *pih; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Physics.GetPtr(&pih))) - return ade_set_error(L, "o", l_Physics.Set(physics_info_h())); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Physics.GetPtr(&pih))) //-V510 + return ade_set_error(L, "o", l_Physics.Set(physics_info_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Physics.Set(physics_info_h())); + return ade_set_error(L, "o", l_Physics.Set(physics_info_h())); //-V510 if(ADE_SETTING_VAR && pih->IsValid()) { objh->objp->phys_info = *pih->pi; } - return ade_set_args(L, "o", l_Physics.Set(physics_info_h(objh->objp))); + return ade_set_args(L, "o", l_Physics.Set(physics_info_h(objh->objp))); //-V510 } ADE_VIRTVAR(HitpointsLeft, l_Object, "number", "Hitpoints an object has left", "number", "Hitpoints left, or 0 if handle is invalid") { object_h *objh = NULL; float f = -1.0f; - if(!ade_get_args(L, "o|f", l_Object.GetPtr(&objh), &f)) + if(!ade_get_args(L, "o|f", l_Object.GetPtr(&objh), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -4355,11 +4355,11 @@ ADE_VIRTVAR(Shields, l_Object, "shields", "Shields", "shields", "Shields handle, { object_h *objh; object_h *sobjh; - if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Shields.GetPtr(&sobjh))) - return ade_set_error(L, "o", l_Shields.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Object.GetPtr(&objh), l_Shields.GetPtr(&sobjh))) //-V510 + return ade_set_error(L, "o", l_Shields.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Shields.Set(object_h())); + return ade_set_error(L, "o", l_Shields.Set(object_h())); //-V510 //WMC - copy shields if(ADE_SETTING_VAR && sobjh != NULL && sobjh->IsValid()) @@ -4368,13 +4368,13 @@ ADE_VIRTVAR(Shields, l_Object, "shields", "Shields", "shields", "Shields handle, shield_set_quad(objh->objp, i, shield_get_quad(sobjh->objp, i)); } - return ade_set_args(L, "o", l_Shields.Set(object_h(objh->objp))); + return ade_set_args(L, "o", l_Shields.Set(object_h(objh->objp))); //-V510 } ADE_FUNC(getSignature, l_Object, NULL, "Gets the object's unique signature", "number", "Returns the objects unique numeric signature, or -1 if invalid. useful for creating a metadata sytem") { object_h *oh; - if(!ade_get_args(L, "o", l_Object.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_Object.GetPtr(&oh))) //-V510 return ade_set_error(L, "i", -1); if(!oh->IsValid()) @@ -4386,7 +4386,7 @@ ADE_FUNC(getSignature, l_Object, NULL, "Gets the object's unique signature", "nu ADE_FUNC(isValid, l_Object, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { object_h *oh; - if(!ade_get_args(L, "o", l_Object.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_Object.GetPtr(&oh))) //-V510 return ADE_RETURN_FALSE; return ade_set_args(L, "b", oh->IsValid()); @@ -4395,7 +4395,7 @@ ADE_FUNC(isValid, l_Object, NULL, "Detects whether handle is valid", "boolean", ADE_FUNC(getBreedName, l_Object, NULL, "Gets object type", "string", "Object type name, or empty string if handle is invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Object.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Object.GetPtr(&objh))) //-V510 return ade_set_error(L, "s", ""); if(!objh->IsValid()) @@ -4408,7 +4408,7 @@ ADE_VIRTVAR(CollisionGroups, l_Object, "number", "Collision group data", "number { object_h *objh = NULL; int id = 0; - if(!ade_get_args(L, "o|i", l_Object.GetPtr(&objh), &id)) + if(!ade_get_args(L, "o|i", l_Object.GetPtr(&objh), &id)) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid()) @@ -4428,7 +4428,7 @@ ADE_FUNC(getfvec, l_Object, "[boolean normalize]", "Returns the objects' current object *obj = NULL; bool normalize = false; - if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) { + if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) { //-V510 return ADE_RETURN_NIL; } @@ -4440,7 +4440,7 @@ ADE_FUNC(getfvec, l_Object, "[boolean normalize]", "Returns the objects' current if (normalize) vm_vec_normalize(&v1); - return ade_set_args(L, "o", l_Vector.Set(v1)); + return ade_set_args(L, "o", l_Vector.Set(v1)); //-V510 } ADE_FUNC(getuvec, l_Object, "[boolean normalize]", "Returns the objects' current uvec.", "vector", "Objects' up vector, or nil if invalid. If called with a true argument, vector will be normalized.") @@ -4449,7 +4449,7 @@ ADE_FUNC(getuvec, l_Object, "[boolean normalize]", "Returns the objects' current object *obj = NULL; bool normalize = false; - if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) { + if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) { //-V510 return ADE_RETURN_NIL; } @@ -4461,7 +4461,7 @@ ADE_FUNC(getuvec, l_Object, "[boolean normalize]", "Returns the objects' current if (normalize) vm_vec_normalize(&v1); - return ade_set_args(L, "o", l_Vector.Set(v1)); + return ade_set_args(L, "o", l_Vector.Set(v1)); //-V510 } ADE_FUNC(getrvec, l_Object, "[boolean normalize]", "Returns the objects' current rvec.", "vector", "Objects' rvec, or nil if invalid. If called with a true argument, vector will be normalized.") @@ -4470,7 +4470,7 @@ ADE_FUNC(getrvec, l_Object, "[boolean normalize]", "Returns the objects' current object *obj = NULL; bool normalize = false; - if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) { + if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) { //-V510 return ADE_RETURN_NIL; } @@ -4482,7 +4482,7 @@ ADE_FUNC(getrvec, l_Object, "[boolean normalize]", "Returns the objects' current if (normalize) vm_vec_normalize(&v1); - return ade_set_args(L, "o", l_Vector.Set(v1)); + return ade_set_args(L, "o", l_Vector.Set(v1)); //-V510 } ADE_FUNC(checkRayCollision, l_Object, "vector Start Point, vector End Point, [boolean Local]", "Checks the collisions between the polygons of the current object and a ray", "vector, collision info", "World collision point (local if boolean is set to true) and the specific collsision info, nil if no collisions") @@ -4492,7 +4492,7 @@ ADE_FUNC(checkRayCollision, l_Object, "vector Start Point, vector End Point, [bo int model_num = -1, model_instance_num = -1, temp = 0; vec3d *v3a, *v3b; bool local = false; - if(!ade_get_args(L, "ooo|b", l_Object.GetPtr(&objh), l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b), &local)) + if(!ade_get_args(L, "ooo|b", l_Object.GetPtr(&objh), l_Vector.GetPtr(&v3a), l_Vector.GetPtr(&v3b), &local)) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) @@ -4548,9 +4548,9 @@ ADE_FUNC(checkRayCollision, l_Object, "vector Start Point, vector End Point, [bo } if (local) - return ade_set_args(L, "oo", l_Vector.Set(hull_check.hit_point), l_ColInfo.Set(mc_info_h(new mc_info(hull_check)))); + return ade_set_args(L, "oo", l_Vector.Set(hull_check.hit_point), l_ColInfo.Set(mc_info_h(new mc_info(hull_check)))); //-V510 else - return ade_set_args(L, "oo", l_Vector.Set(hull_check.hit_point_world), l_ColInfo.Set(mc_info_h(new mc_info(hull_check)))); + return ade_set_args(L, "oo", l_Vector.Set(hull_check.hit_point_world), l_ColInfo.Set(mc_info_h(new mc_info(hull_check)))); //-V510 } //**********HANDLE: Asteroid @@ -4560,11 +4560,11 @@ ADE_VIRTVAR(Target, l_Asteroid, "object", "Asteroid target object; may be object { object_h *oh = NULL; object_h *th = NULL; - if(!ade_get_args(L, "o|o", l_Asteroid.GetPtr(&oh), l_Object.GetPtr(&th))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Asteroid.GetPtr(&oh), l_Object.GetPtr(&th))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 asteroid *asp = &Asteroids[oh->objp->instance]; @@ -4578,7 +4578,7 @@ ADE_VIRTVAR(Target, l_Asteroid, "object", "Asteroid target object; may be object if(asp->target_objnum > 0 && asp->target_objnum < MAX_OBJECTS) return ade_set_object_with_breed(L, asp->target_objnum); else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 } @@ -4590,7 +4590,7 @@ ADE_FUNC(__tostring, l_Shipclass, NULL, "Ship class name", "string", "Ship class { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4603,7 +4603,7 @@ ADE_VIRTVAR(Name, l_Shipclass, "string", "Ship class name", "string", "Ship clas { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4620,7 +4620,7 @@ ADE_VIRTVAR(ShortName, l_Shipclass, "string", "Ship class short name", "string", { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4637,7 +4637,7 @@ ADE_VIRTVAR(TypeString, l_Shipclass, "string", "Ship class type string", "string { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4665,7 +4665,7 @@ ADE_VIRTVAR(ManeuverabilityString, l_Shipclass, "string", "Ship class maneuverab { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4693,7 +4693,7 @@ ADE_VIRTVAR(ArmorString, l_Shipclass, "string", "Ship class armor string", "stri { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4721,7 +4721,7 @@ ADE_VIRTVAR(ManufacturerString, l_Shipclass, "string", "Ship class manufacturer" { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4750,7 +4750,7 @@ ADE_VIRTVAR(Description, l_Shipclass, "string", "Ship class description", "strin { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4778,7 +4778,7 @@ ADE_VIRTVAR(TechDescription, l_Shipclass, "string", "Ship class tech description { int idx; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) + if(!ade_get_args(L, "o|s", l_Shipclass.Get(&idx), &s)) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx > Num_ship_classes) @@ -4806,7 +4806,7 @@ ADE_VIRTVAR(AfterburnerFuelMax, l_Shipclass, "number", "Afterburner fuel capacit { int idx; float fuel = -1.0f; - if(!ade_get_args(L, "o|f", l_Shipclass.Get(&idx), &fuel)) + if(!ade_get_args(L, "o|f", l_Shipclass.Get(&idx), &fuel)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_ship_classes) @@ -4822,7 +4822,7 @@ ADE_VIRTVAR(CountermeasuresMax, l_Shipclass, "number", "Maximum number of counte { int idx; int i = -1; - if(!ade_get_args(L, "o|i", l_Shipclass.Get(&idx), &i)) + if(!ade_get_args(L, "o|i", l_Shipclass.Get(&idx), &i)) //-V510 return ade_set_error(L, "i", 0); if(idx < 0 || idx > Num_ship_classes) @@ -4839,11 +4839,11 @@ ADE_VIRTVAR(Model, l_Shipclass, "model", "Model", "model", "Ship class model, or { int ship_info_idx=-1; model_h *mdl = NULL; - if(!ade_get_args(L, "o|o", l_Shipclass.Get(&ship_info_idx), l_Model.GetPtr(&mdl))) - return ade_set_error(L, "o", l_Model.Set(-1)); + if(!ade_get_args(L, "o|o", l_Shipclass.Get(&ship_info_idx), l_Model.GetPtr(&mdl))) //-V510 + return ade_set_error(L, "o", l_Model.Set(-1)); //-V510 if(ship_info_idx < 0 || ship_info_idx > Num_ship_classes) - return ade_set_error(L, "o", l_Model.Set(-1)); + return ade_set_error(L, "o", l_Model.Set(-1)); //-V510 ship_info *sip = &Ship_info[ship_info_idx]; @@ -4853,18 +4853,18 @@ ADE_VIRTVAR(Model, l_Shipclass, "model", "Model", "model", "Ship class model, or sip->model_num = mid; } - return ade_set_args(L, "o", l_Model.Set(model_h(sip->model_num))); + return ade_set_args(L, "o", l_Model.Set(model_h(sip->model_num))); //-V510 } ADE_VIRTVAR(CockpitModel, l_Shipclass, "model", "Model used for first-person cockpit", "model", "Cockpit model") { int ship_info_idx=-1; model_h *mdl = NULL; - if(!ade_get_args(L, "o|o", l_Shipclass.Get(&ship_info_idx), l_Model.GetPtr(&mdl))) - return ade_set_error(L, "o", l_Model.Set(model_h())); + if(!ade_get_args(L, "o|o", l_Shipclass.Get(&ship_info_idx), l_Model.GetPtr(&mdl))) //-V510 + return ade_set_error(L, "o", l_Model.Set(model_h())); //-V510 if(ship_info_idx < 0 || ship_info_idx > Num_ship_classes) - return ade_set_error(L, "o", l_Model.Set(model_h())); + return ade_set_error(L, "o", l_Model.Set(model_h())); //-V510 ship_info *sip = &Ship_info[ship_info_idx]; @@ -4874,14 +4874,14 @@ ADE_VIRTVAR(CockpitModel, l_Shipclass, "model", "Model used for first-person coc sip->cockpit_model_num = mid; } - return ade_set_args(L, "o", l_Model.Set(model_h(sip->cockpit_model_num))); + return ade_set_args(L, "o", l_Model.Set(model_h(sip->cockpit_model_num))); //-V510 } ADE_VIRTVAR(HitpointsMax, l_Shipclass, "number", "Ship class hitpoints", "number", "Hitpoints, or 0 if handle is invalid") { int idx; float f = -1.0f; - if(!ade_get_args(L, "o|f", l_Shipclass.Get(&idx), &f)) + if(!ade_get_args(L, "o|f", l_Shipclass.Get(&idx), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(idx < 0 || idx > Num_ship_classes) @@ -4898,40 +4898,40 @@ ADE_VIRTVAR(Species, l_Shipclass, "Species", "Ship class species", "species", "S { int idx; int sidx; - if(!ade_get_args(L, "o|o", l_Shipclass.Get(&idx), l_Species.Get(&sidx))) - return ade_set_error(L, "o", l_Species.Set(-1)); + if(!ade_get_args(L, "o|o", l_Shipclass.Get(&idx), l_Species.Get(&sidx))) //-V510 + return ade_set_error(L, "o", l_Species.Set(-1)); //-V510 if(idx < 0 || idx > Num_ship_classes) - return ade_set_error(L, "o", l_Species.Set(-1)); + return ade_set_error(L, "o", l_Species.Set(-1)); //-V510 if(ADE_SETTING_VAR && sidx > -1 && sidx < (int)Species_info.size()) { Ship_info[idx].species = sidx; } - return ade_set_args(L, "o", l_Species.Set(Ship_info[idx].species)); + return ade_set_args(L, "o", l_Species.Set(Ship_info[idx].species)); //-V510 } ADE_VIRTVAR(Type, l_Shipclass, "shiptype", "Ship class type", "shiptype", "Ship type, or invalid handle if shipclass handle is invalid") { int idx; int sidx; - if(!ade_get_args(L, "o|o", l_Shipclass.Get(&idx), l_Shiptype.Get(&sidx))) - return ade_set_error(L, "o", l_Shiptype.Set(-1)); + if(!ade_get_args(L, "o|o", l_Shipclass.Get(&idx), l_Shiptype.Get(&sidx))) //-V510 + return ade_set_error(L, "o", l_Shiptype.Set(-1)); //-V510 if(idx < 0 || idx > Num_ship_classes) - return ade_set_error(L, "o", l_Shiptype.Set(-1)); + return ade_set_error(L, "o", l_Shiptype.Set(-1)); //-V510 if(ADE_SETTING_VAR && sidx > -1 && sidx < (int)Ship_types.size()) { Ship_info[idx].class_type = sidx; } - return ade_set_args(L, "o", l_Shiptype.Set(Ship_info[idx].class_type)); + return ade_set_args(L, "o", l_Shiptype.Set(Ship_info[idx].class_type)); //-V510 } ADE_FUNC(isValid, l_Shipclass, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Shipclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Shipclass.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Num_ship_classes) @@ -4943,7 +4943,7 @@ ADE_FUNC(isValid, l_Shipclass, NULL, "Detects whether handle is valid", "boolean ADE_FUNC(isInTechroom, l_Shipclass, NULL, "Gets whether or not the ship class is available in the techroom", "boolean", "Whether ship has been revealed in the techroom, false if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Shipclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Shipclass.Get(&idx))) //-V510 return ade_set_error(L, "b", false); if(idx < 0 || idx > Num_ship_classes) @@ -4966,7 +4966,7 @@ ADE_FUNC(renderTechModel, l_Shipclass, "X1, Y1, X2, Y2, [Rotation %, Pitch %, Ba angles rot_angles = {0.0f, 0.0f, 40.0f}; int idx; float zoom = 1.3f; - if(!ade_get_args(L, "oiiii|ffff", l_Shipclass.Get(&idx), &x1, &y1, &x2, &y2, &rot_angles.h, &rot_angles.p, &rot_angles.b, &zoom)) + if(!ade_get_args(L, "oiiii|ffff", l_Shipclass.Get(&idx), &x1, &y1, &x2, &y2, &rot_angles.h, &rot_angles.p, &rot_angles.b, &zoom)) //-V510 return ade_set_error(L, "b", false); if(idx < 0 || idx > Num_ship_classes) @@ -5051,7 +5051,7 @@ ADE_FUNC(renderTechModel2, l_Shipclass, "X1, Y1, X2, Y2, orientation Orientation int idx; float zoom = 1.3f; matrix_h *mh = NULL; - if(!ade_get_args(L, "oiiiio|f", l_Shipclass.Get(&idx), &x1, &y1, &x2, &y2, l_Matrix.GetPtr(&mh), &zoom)) + if(!ade_get_args(L, "oiiiio|f", l_Shipclass.Get(&idx), &x1, &y1, &x2, &y2, l_Matrix.GetPtr(&mh), &zoom)) //-V510 return ade_set_error(L, "b", false); if(idx < 0 || idx > Num_ship_classes) @@ -5113,7 +5113,7 @@ ADE_FUNC(isModelLoaded, l_Shipclass, "[boolean Load = false]", "Checks if the mo { int idx; bool load_check = false; - if(!ade_get_args(L, "o|b", l_Shipclass.Get(&idx), &load_check)) + if(!ade_get_args(L, "o|b", l_Shipclass.Get(&idx), &load_check)) //-V510 return ADE_RETURN_FALSE; ship_info *sip = &Ship_info[idx]; @@ -5134,7 +5134,7 @@ ADE_FUNC(isModelLoaded, l_Shipclass, "[boolean Load = false]", "Checks if the mo ADE_FUNC(getShipClassIndex, l_Shipclass, NULL, "Gets the index valus of the ship class", "number", "index value of the ship class") { int idx; - if(!ade_get_args(L, "o", l_Shipclass.Get(&idx))) + if(!ade_get_args(L, "o", l_Shipclass.Get(&idx))) //-V510 return ade_set_args(L, "i", -1); if(idx < 0 || idx >= Num_ship_classes) @@ -5150,7 +5150,7 @@ ADE_VIRTVAR(IsHull, l_Debris, "boolean", "Whether or not debris is a piece of hu { object_h *oh; bool b=false; - if(!ade_get_args(L, "o|b", l_Debris.GetPtr(&oh), &b)) + if(!ade_get_args(L, "o|b", l_Debris.GetPtr(&oh), &b)) //-V510 return ade_set_error(L, "b", false); if(!oh->IsValid()) @@ -5170,11 +5170,11 @@ ADE_VIRTVAR(OriginClass, l_Debris, "shipclass", "The shipclass of the ship this { object_h *oh; int shipIdx = -1; - if(!ade_get_args(L, "o|o", l_Debris.GetPtr(&oh), &shipIdx)) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + if(!ade_get_args(L, "o|o", l_Debris.GetPtr(&oh), &shipIdx)) //-V510 + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 debris *db = &Debris[oh->objp->instance]; @@ -5183,13 +5183,13 @@ ADE_VIRTVAR(OriginClass, l_Debris, "shipclass", "The shipclass of the ship this db->ship_info_index = shipIdx; } - return ade_set_error(L, "o", l_Shipclass.Set(db->ship_info_index)); + return ade_set_error(L, "o", l_Shipclass.Set(db->ship_info_index)); //-V510 } ADE_FUNC(getDebrisRadius, l_Debris, NULL, "The radius of this debris piece", "number", "The radius of this debris piece or -1 if invalid") { object_h *oh; - if(!ade_get_args(L, "o", l_Debris.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_Debris.GetPtr(&oh))) //-V510 return ade_set_error(L, "f", -1.0f); if(!oh->IsValid()) @@ -5211,7 +5211,7 @@ ADE_FUNC(getDebrisRadius, l_Debris, NULL, "The radius of this debris piece", "nu ADE_FUNC(isValid, l_Debris, NULL, "Return if this debris handle is valid", "boolean", "true if valid false otherwise") { object_h *oh; - if(!ade_get_args(L, "o", l_Debris.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_Debris.GetPtr(&oh))) //-V510 return ADE_RETURN_FALSE; return ade_set_args(L, "b", oh != NULL && oh->IsValid()); @@ -5250,11 +5250,11 @@ ADE_INDEXER(l_WaypointList, "number Index", "Array of waypoints that are part of int idx = -1; waypointlist_h* wlh = NULL; char wpname[128]; - if( !ade_get_args(L, "oi", l_WaypointList.GetPtr( &wlh ), &idx)) - return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); + if( !ade_get_args(L, "oi", l_WaypointList.GetPtr( &wlh ), &idx)) //-V510 + return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); //-V510 if(!wlh->IsValid()) - return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); + return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); //-V510 //Lua-->FS2 idx--; @@ -5263,10 +5263,10 @@ ADE_INDEXER(l_WaypointList, "number Index", "Array of waypoints that are part of sprintf(wpname, "%s:%d", wlh->wlp->get_name(), calc_waypoint_index(idx) + 1); waypoint *wpt = find_matching_waypoint( wpname ); if( idx >= 0 && (uint) idx < wlh->wlp->get_waypoints().size() && wpt != NULL ) { - return ade_set_args( L, "o", l_Waypoint.Set( object_h( &Objects[wpt->get_objnum()] ), Objects[wpt->get_objnum()].signature ) ); + return ade_set_args( L, "o", l_Waypoint.Set( object_h( &Objects[wpt->get_objnum()] ), Objects[wpt->get_objnum()].signature ) ); //-V510 } - return ade_set_error(L, "o", l_Waypoint.Set( object_h() ) ); + return ade_set_error(L, "o", l_Waypoint.Set( object_h() ) ); //-V510 } ADE_FUNC(__len, l_WaypointList, @@ -5277,8 +5277,8 @@ ADE_FUNC(__len, l_WaypointList, "Number of waypoints in the list, or 0 if handle is invalid") { waypointlist_h* wlh = NULL; - if ( !ade_get_args(L, "o", l_WaypointList.GetPtr(&wlh)) ) { - return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); + if ( !ade_get_args(L, "o", l_WaypointList.GetPtr(&wlh)) ) { //-V510 + return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); //-V510 } return ade_set_args(L, "i", wlh->wlp->get_waypoints().size()); } @@ -5286,8 +5286,8 @@ ADE_FUNC(__len, l_WaypointList, ADE_VIRTVAR(Name, l_WaypointList, "string", "Name of WaypointList", "string", "Waypointlist name, or empty string if handle is invalid") { waypointlist_h* wlh = NULL; - if ( !ade_get_args(L, "o", l_WaypointList.GetPtr(&wlh)) ) { - return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); + if ( !ade_get_args(L, "o", l_WaypointList.GetPtr(&wlh)) ) { //-V510 + return ade_set_error( L, "o", l_Waypoint.Set( object_h() ) ); //-V510 } return ade_set_args( L, "s", wlh->name); } @@ -5397,11 +5397,11 @@ ADE_VIRTVAR(WeaponClass, l_WeaponBank, "weaponclass", "Class of weapon mounted i { ship_bank_h *bh = NULL; int weaponclass=-1; - if(!ade_get_args(L, "o|o", l_WeaponBank.GetPtr(&bh), l_Weaponclass.Get(&weaponclass))) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + if(!ade_get_args(L, "o|o", l_WeaponBank.GetPtr(&bh), l_Weaponclass.Get(&weaponclass))) //-V510 + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 if(!bh->IsValid()) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 switch(bh->type) { @@ -5410,13 +5410,13 @@ ADE_VIRTVAR(WeaponClass, l_WeaponBank, "weaponclass", "Class of weapon mounted i bh->sw->primary_bank_weapons[bh->bank] = weaponclass; } - return ade_set_args(L, "o", l_Weaponclass.Set(bh->sw->primary_bank_weapons[bh->bank])); + return ade_set_args(L, "o", l_Weaponclass.Set(bh->sw->primary_bank_weapons[bh->bank])); //-V510 case SWH_SECONDARY: if(ADE_SETTING_VAR && weaponclass > -1) { bh->sw->secondary_bank_weapons[bh->bank] = weaponclass; } - return ade_set_args(L, "o", l_Weaponclass.Set(bh->sw->secondary_bank_weapons[bh->bank])); + return ade_set_args(L, "o", l_Weaponclass.Set(bh->sw->secondary_bank_weapons[bh->bank])); //-V510 case SWH_TERTIARY: if(ADE_SETTING_VAR && weaponclass > -1) { //bh->sw->tertiary_bank_weapons[bh->bank] = weaponclass; @@ -5428,14 +5428,14 @@ ADE_VIRTVAR(WeaponClass, l_WeaponBank, "weaponclass", "Class of weapon mounted i return ADE_RETURN_FALSE; } - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 } ADE_VIRTVAR(AmmoLeft, l_WeaponBank, "number", "Ammo left for the current bank", "number", "Ammo left, or 0 if handle is invalid") { ship_bank_h *bh = NULL; int ammo; - if(!ade_get_args(L, "o|i", l_WeaponBank.GetPtr(&bh), &ammo)) + if(!ade_get_args(L, "o|i", l_WeaponBank.GetPtr(&bh), &ammo)) //-V510 return ade_set_error(L, "i", 0); if(!bh->IsValid()) @@ -5469,7 +5469,7 @@ ADE_VIRTVAR(AmmoMax, l_WeaponBank, "number", "Maximum ammo for the current bank" { ship_bank_h *bh = NULL; int ammomax; - if(!ade_get_args(L, "o|i", l_WeaponBank.GetPtr(&bh), &ammomax)) + if(!ade_get_args(L, "o|i", l_WeaponBank.GetPtr(&bh), &ammomax)) //-V510 return ade_set_error(L, "i", 0); if(!bh->IsValid()) @@ -5504,7 +5504,7 @@ ADE_VIRTVAR(Armed, l_WeaponBank, "boolean", "Weapon armed status. Does not take { ship_bank_h *bh = NULL; bool armthis=false; - if(!ade_get_args(L, "o|b", l_WeaponBank.GetPtr(&bh), &armthis)) + if(!ade_get_args(L, "o|b", l_WeaponBank.GetPtr(&bh), &armthis)) //-V510 return ade_set_error(L, "b", false); if(!bh->IsValid()) @@ -5539,7 +5539,7 @@ ADE_VIRTVAR(Armed, l_WeaponBank, "boolean", "Weapon armed status. Does not take ADE_FUNC(isValid, l_WeaponBank, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { ship_bank_h *bh; - if(!ade_get_args(L, "o", l_WeaponBank.GetPtr(&bh))) + if(!ade_get_args(L, "o", l_WeaponBank.GetPtr(&bh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", bh->IsValid()); @@ -5553,17 +5553,17 @@ ADE_INDEXER(l_WeaponBankType, "number Index", "Array of weapon banks", "weaponba ship_banktype_h *sb=NULL; int idx = -1; ship_bank_h *newbank; - if(!ade_get_args(L, "oi|o", l_WeaponBankType.GetPtr(&sb), &idx, l_WeaponBank.GetPtr(&newbank))) - return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); + if(!ade_get_args(L, "oi|o", l_WeaponBankType.GetPtr(&sb), &idx, l_WeaponBank.GetPtr(&newbank))) //-V510 + return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //-V510 if(!sb->IsValid()) - return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); + return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //-V510 switch(sb->type) { case SWH_PRIMARY: if(idx < 1 || idx > sb->sw->num_primary_banks) - return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); + return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //-V510 idx--; //Lua->FS2 @@ -5578,7 +5578,7 @@ ADE_INDEXER(l_WeaponBankType, "number Index", "Array of weapon banks", "weaponba break; case SWH_SECONDARY: if(idx < 1 || idx > sb->sw->num_secondary_banks) - return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); + return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //-V510 idx--; //Lua->FS2 @@ -5592,7 +5592,7 @@ ADE_INDEXER(l_WeaponBankType, "number Index", "Array of weapon banks", "weaponba break; case SWH_TERTIARY: if(idx < 1 || idx > sb->sw->num_tertiary_banks) - return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); + return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //-V510 idx--; //Lua->FS2 @@ -5602,17 +5602,17 @@ ADE_INDEXER(l_WeaponBankType, "number Index", "Array of weapon banks", "weaponba } break; default: - return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //Invalid type + return ade_set_error(L, "o", l_WeaponBank.Set(ship_bank_h())); //Invalid type //-V510 } - return ade_set_args(L, "o", l_WeaponBank.Set(ship_bank_h(sb->objp, sb->sw, sb->type, idx))); + return ade_set_args(L, "o", l_WeaponBank.Set(ship_bank_h(sb->objp, sb->sw, sb->type, idx))); //-V510 } ADE_VIRTVAR(Linked, l_WeaponBankType, "boolean", "Whether bank is in linked or unlinked fire mode (Primary-only)", "boolean", "Link status, or false if handle is invalid") { ship_banktype_h *bh; bool newlink = false; - int numargs = ade_get_args(L, "o|b", l_WeaponBankType.GetPtr(&bh), &newlink); + int numargs = ade_get_args(L, "o|b", l_WeaponBankType.GetPtr(&bh), &newlink); //-V510 if(!numargs) return ade_set_error(L, "b", false); @@ -5644,7 +5644,7 @@ ADE_VIRTVAR(DualFire, l_WeaponBankType, "boolean", "Whether bank is in dual fire { ship_banktype_h *bh; bool newfire = false; - int numargs = ade_get_args(L, "o|b", l_WeaponBankType.GetPtr(&bh), &newfire); + int numargs = ade_get_args(L, "o|b", l_WeaponBankType.GetPtr(&bh), &newfire); //-V510 if(!numargs) return ade_set_error(L, "b", false); @@ -5675,7 +5675,7 @@ ADE_VIRTVAR(DualFire, l_WeaponBankType, "boolean", "Whether bank is in dual fire ADE_FUNC(isValid, l_WeaponBankType, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { ship_banktype_h *sb; - if(!ade_get_args(L, "o", l_WeaponBankType.GetPtr(&sb))) + if(!ade_get_args(L, "o", l_WeaponBankType.GetPtr(&sb))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", sb->IsValid()); @@ -5684,7 +5684,7 @@ ADE_FUNC(isValid, l_WeaponBankType, NULL, "Detects whether handle is valid", "bo ADE_FUNC(__len, l_WeaponBankType, NULL, "Number of weapons in the mounted bank", "number", "Number of bank weapons, or 0 if handle is invalid") { ship_banktype_h *sb=NULL; - if(!ade_get_args(L, "o", l_WeaponBankType.GetPtr(&sb))) + if(!ade_get_args(L, "o", l_WeaponBankType.GetPtr(&sb))) //-V510 return ade_set_error(L, "i", 0); if(!sb->IsValid()) @@ -5721,7 +5721,7 @@ ade_obj l_Subsystem("subsystem", "Ship subsystem handle"); ADE_FUNC(__tostring, l_Subsystem, NULL, "Returns name of subsystem", "string", "Subsystem name, or empty string if handle is invalid") { ship_subsys_h *sso; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 return ade_set_error(L, "s", ""); if(!sso->IsValid()) @@ -5734,7 +5734,7 @@ ADE_VIRTVAR(AWACSIntensity, l_Subsystem, "number", "Subsystem AWACS intensity", { ship_subsys_h *sso; float f = -1.0f; - if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) + if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!sso->IsValid()) @@ -5750,7 +5750,7 @@ ADE_VIRTVAR(AWACSRadius, l_Subsystem, "number", "Subsystem AWACS radius", "numbe { ship_subsys_h *sso; float f = -1.0f; - if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) + if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!sso->IsValid()) @@ -5766,43 +5766,43 @@ ADE_VIRTVAR(Orientation, l_Subsystem, "orientation", "Orientation of subobject o { ship_subsys_h *sso; matrix_h *mh; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Matrix.GetPtr(&mh))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Matrix.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 if(ADE_SETTING_VAR && mh != NULL) { sso->ss->submodel_info_1.angs = *mh->GetAngles(); } - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&sso->ss->submodel_info_1.angs))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&sso->ss->submodel_info_1.angs))); //-V510 } ADE_VIRTVAR(GunOrientation, l_Subsystem, "orientation", "Orientation of turret gun", "orientation", "Gun orientation, or null orientation if handle is invalid") { ship_subsys_h *sso; matrix_h *mh; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Matrix.GetPtr(&mh))) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Matrix.GetPtr(&mh))) //-V510 + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 if(ADE_SETTING_VAR && mh != NULL) { sso->ss->submodel_info_2.angs = *mh->GetAngles(); } - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&sso->ss->submodel_info_2.angs))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&sso->ss->submodel_info_2.angs))); //-V510 } ADE_VIRTVAR(HitpointsLeft, l_Subsystem, "number", "Subsystem hitpoints left", "number", "Hitpoints left, or 0 if handle is invalid. Setting a value of 0 will disable it - set a value of -1 or lower to actually blow it up.") { ship_subsys_h *sso; float f = -1.0f; - if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) + if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!sso->IsValid()) @@ -5827,7 +5827,7 @@ ADE_VIRTVAR(HitpointsMax, l_Subsystem, "number", "Subsystem hitpoints max", "num { ship_subsys_h *sso; float f = -1.0f; - if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) + if(!ade_get_args(L, "o|f", l_Subsystem.GetPtr(&sso), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!sso->IsValid()) @@ -5847,49 +5847,49 @@ ADE_VIRTVAR(Position, l_Subsystem, "vector", "Subsystem position with regards to { ship_subsys_h *sso; vec3d *v = NULL; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Vector.GetPtr(&v))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Vector.GetPtr(&v))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR && v != NULL) { sso->ss->system_info->pnt = *v; } - return ade_set_args(L, "o", l_Vector.Set(sso->ss->system_info->pnt)); + return ade_set_args(L, "o", l_Vector.Set(sso->ss->system_info->pnt)); //-V510 } ADE_VIRTVAR(GunPosition, l_Subsystem, "vector", "Subsystem gun position with regards to main ship (Local vector)", "vector", "Gun position, or null vector if subsystem handle is invalid") { ship_subsys_h *sso; vec3d *v = NULL; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Vector.GetPtr(&v))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Vector.GetPtr(&v))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 polymodel *pm = model_get(Ship_info[Ships[sso->objp->instance].ship_info_index].model_num); Assert(pm != NULL); if(sso->ss->system_info->turret_gun_sobj < 0) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 bsp_info *sm = &pm->submodel[sso->ss->system_info->turret_gun_sobj]; if(ADE_SETTING_VAR && v != NULL) sm->offset = *v; - return ade_set_args(L, "o", l_Vector.Set(sm->offset)); + return ade_set_args(L, "o", l_Vector.Set(sm->offset)); //-V510 } ADE_VIRTVAR(Name, l_Subsystem, "string", "Subsystem name", "string", "Subsystem name, or an empty string if handle is invalid") { ship_subsys_h *sso; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Subsystem.GetPtr(&sso), &s)) + if(!ade_get_args(L, "o|s", l_Subsystem.GetPtr(&sso), &s)) //-V510 return ade_set_error(L, "s", ""); if(!sso->IsValid()) @@ -5907,11 +5907,11 @@ ADE_VIRTVAR(Name, l_Subsystem, "string", "Subsystem name", "string", "Subsystem ADE_VIRTVAR(PrimaryBanks, l_Subsystem, "weaponbanktype", "Array of primary weapon banks", "weaponbanktype", "Primary banks, or invalid weaponbanktype handle if subsystem handle is invalid") { ship_subsys_h *sso, *sso2; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Subsystem.GetPtr(&sso2))) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Subsystem.GetPtr(&sso2))) //-V510 + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 ship_weapon *dst = &sso->ss->weapons; @@ -5931,17 +5931,17 @@ ADE_VIRTVAR(PrimaryBanks, l_Subsystem, "weaponbanktype", "Array of primary weapo memcpy(dst->primary_bank_weapons, src->primary_bank_weapons, sizeof(dst->primary_bank_weapons)); } - return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(sso->objp, dst, SWH_PRIMARY))); + return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(sso->objp, dst, SWH_PRIMARY))); //-V510 } ADE_VIRTVAR(SecondaryBanks, l_Subsystem, "weaponbanktype", "Array of secondary weapon banks", "weaponbanktype", "Secondary banks, or invalid weaponbanktype handle if subsystem handle is invalid") { ship_subsys_h *sso, *sso2; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Subsystem.GetPtr(&sso2))) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Subsystem.GetPtr(&sso2))) //-V510 + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 ship_weapon *dst = &sso->ss->weapons; @@ -5962,7 +5962,7 @@ ADE_VIRTVAR(SecondaryBanks, l_Subsystem, "weaponbanktype", "Array of secondary w memcpy(dst->secondary_next_slot, src->secondary_next_slot, sizeof(dst->secondary_next_slot)); } - return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(sso->objp, dst, SWH_SECONDARY))); + return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(sso->objp, dst, SWH_SECONDARY))); //-V510 } @@ -5970,11 +5970,11 @@ ADE_VIRTVAR(Target, l_Subsystem, "object", "Object targetted by this subsystem. { ship_subsys_h *sso; object_h *objh; - if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Object.GetPtr(&objh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Subsystem.GetPtr(&sso), l_Object.GetPtr(&objh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 ship_subsys *ss = sso->ss; @@ -5993,7 +5993,7 @@ ADE_VIRTVAR(TurretResets, l_Subsystem, "boolean", "Specifies wether this turrets { ship_subsys_h *sso; bool newVal = false; - if (!ade_get_args(L, "o|b", l_Subsystem.GetPtr(&sso), &newVal)) + if (!ade_get_args(L, "o|b", l_Subsystem.GetPtr(&sso), &newVal)) //-V510 return ADE_RETURN_FALSE; if (!sso->IsValid()) @@ -6021,7 +6021,7 @@ ADE_VIRTVAR(TurretResetDelay, l_Subsystem, "number", "The time (in milliseconds) { ship_subsys_h *sso; int newVal = -1; - if (!ade_get_args(L, "o|i", l_Subsystem.GetPtr(&sso), &newVal)) + if (!ade_get_args(L, "o|i", l_Subsystem.GetPtr(&sso), &newVal)) //-V510 return ade_set_error(L, "i", -1); if (!sso->IsValid()) @@ -6043,7 +6043,7 @@ ADE_VIRTVAR(TurnRate, l_Subsystem, "number", "The turn rate", "number", "Turnrat { ship_subsys_h *sso; float newVal = -1.0f; - if (!ade_get_args(L, "o|i", l_Subsystem.GetPtr(&sso), &newVal)) + if (!ade_get_args(L, "o|i", l_Subsystem.GetPtr(&sso), &newVal)) //-V510 return ade_set_error(L, "i", -1.0f); if (!sso->IsValid()) @@ -6061,7 +6061,7 @@ ADE_FUNC(targetingOverride, l_Subsystem, "boolean", "If set to true, AI targetin { bool targetOverride = false; ship_subsys_h *sso; - if(!ade_get_args(L, "ob", l_Subsystem.GetPtr(&sso), &targetOverride)) + if(!ade_get_args(L, "ob", l_Subsystem.GetPtr(&sso), &targetOverride)) //-V510 return ADE_RETURN_FALSE; if(!sso->IsValid()) @@ -6076,7 +6076,7 @@ ADE_FUNC(targetingOverride, l_Subsystem, "boolean", "If set to true, AI targetin ADE_FUNC(hasFired, l_Subsystem, NULL, "Determine if a subsystem has fired", "boolean", "true if if fired, false if not fired, or nil if invalid. resets fired flag when called.") { ship_subsys_h *sso; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 return ADE_RETURN_NIL; if(!sso->IsValid()) @@ -6092,7 +6092,7 @@ ADE_FUNC(hasFired, l_Subsystem, NULL, "Determine if a subsystem has fired", "boo ADE_FUNC(isTurret, l_Subsystem, NULL, "Determines if this subsystem is a turret", "boolean", "true if subsystem is turret, false otherwise or nil on error") { ship_subsys_h *sso; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 return ADE_RETURN_NIL; if (!sso->IsValid()) @@ -6104,7 +6104,7 @@ ADE_FUNC(isTurret, l_Subsystem, NULL, "Determines if this subsystem is a turret" ADE_FUNC(isValid, l_Subsystem, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { ship_subsys_h *sso; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", sso->IsValid()); @@ -6116,7 +6116,7 @@ ADE_FUNC(fireWeapon, l_Subsystem, "[Turret weapon index = 1, Flak range = 100]", ship_subsys_h *sso; int wnum = 1; float flak_range = 100.0f; - if(!ade_get_args(L, "o|if", l_Subsystem.GetPtr(&sso), &wnum, &flak_range)) + if(!ade_get_args(L, "o|if", l_Subsystem.GetPtr(&sso), &wnum, &flak_range)) //-V510 return ADE_RETURN_NIL; if(!sso->IsValid()) @@ -6148,7 +6148,7 @@ ADE_FUNC(rotateTurret, l_Subsystem, "vector Pos[, boolean reset=false", "Rotates ship_subsys_h *sso; vec3d pos = vmd_zero_vector; bool reset = false; - if (!ade_get_args(L, "oo|b", l_Subsystem.GetPtr(&sso), l_Vector.Get(&pos), &reset)) + if (!ade_get_args(L, "oo|b", l_Subsystem.GetPtr(&sso), l_Vector.Get(&pos), &reset)) //-V510 return ADE_RETURN_NIL; //Get default turret info @@ -6183,11 +6183,11 @@ ADE_FUNC(rotateTurret, l_Subsystem, "vector Pos[, boolean reset=false", "Rotates ADE_FUNC(getTurretHeading, l_Subsystem, NULL, "Returns the turrets forward vector", "vector", "Returns a normalized version of the forward vector or null vector on error") { ship_subsys_h *sso; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!sso->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 //Get default turret info model_subsystem *tp = sso->ss->system_info; @@ -6202,14 +6202,14 @@ ADE_FUNC(getTurretHeading, l_Subsystem, NULL, "Returns the turrets forward vecto vm_vec_normalize(&turret_heading); - return ade_set_args(L, "o", l_Vector.Set(turret_heading)); + return ade_set_args(L, "o", l_Vector.Set(turret_heading)); //-V510 } ADE_FUNC(getFOVs, l_Subsystem, NULL, "Returns current turrets FOVs", "number, number, number", "Standard FOV, maximum barrel elevation, turret base fov.") { ship_subsys_h *sso; float fov, fov_e, fov_y; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 return ADE_RETURN_NIL; if(!sso->IsValid()) @@ -6228,7 +6228,7 @@ ADE_FUNC(getTurretMatrix, l_Subsystem, NULL, "Returns current subsystems turret { ship_subsys_h *sso; matrix m; - if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) + if(!ade_get_args(L, "o", l_Subsystem.GetPtr(&sso))) //-V510 return ADE_RETURN_NIL; if(!sso->IsValid()) @@ -6238,7 +6238,7 @@ ADE_FUNC(getTurretMatrix, l_Subsystem, NULL, "Returns current subsystems turret m = tp->turret_matrix; - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&m))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&m))); //-V510 } //**********HANDLE: shiptextures @@ -6247,7 +6247,7 @@ ade_obj l_ShipTextures("shiptextures", "Ship textures handle"); ADE_FUNC(__len, l_ShipTextures, NULL, "Number of textures on ship", "number", "Number of textures on ship, or 0 if handle is invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_ShipTextures.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_ShipTextures.GetPtr(&objh))) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid()) @@ -6266,11 +6266,11 @@ ADE_INDEXER(l_ShipTextures, "number Index/string TextureFilename", "Array of shi object_h *oh; char *s; int tdx=-1; - if (!ade_get_args(L, "os|o", l_ShipTextures.GetPtr(&oh), &s, l_Texture.Get(&tdx))) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if (!ade_get_args(L, "os|o", l_ShipTextures.GetPtr(&oh), &s, l_Texture.Get(&tdx))) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if (!oh->IsValid() || s==NULL) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 ship *shipp = &Ships[oh->objp->instance]; polymodel *pm = model_get(Ship_info[shipp->ship_info_index].model_num); @@ -6309,7 +6309,7 @@ ADE_INDEXER(l_ShipTextures, "number Index/string TextureFilename", "Array of shi final_index = atoi(s) - 1; //Lua->FS2 if (final_index < 0 || final_index >= MAX_REPLACEMENT_TEXTURES) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 } if (ADE_SETTING_VAR) { @@ -6327,15 +6327,15 @@ ADE_INDEXER(l_ShipTextures, "number Index/string TextureFilename", "Array of shi } if (shipp->ship_replacement_textures != NULL && shipp->ship_replacement_textures[final_index] >= 0) - return ade_set_args(L, "o", l_Texture.Set(shipp->ship_replacement_textures[final_index])); + return ade_set_args(L, "o", l_Texture.Set(shipp->ship_replacement_textures[final_index])); //-V510 else - return ade_set_args(L, "o", l_Texture.Set(pm->maps[final_index / TM_NUM_TYPES].textures[final_index % TM_NUM_TYPES].GetTexture())); + return ade_set_args(L, "o", l_Texture.Set(pm->maps[final_index / TM_NUM_TYPES].textures[final_index % TM_NUM_TYPES].GetTexture())); //-V510 } ADE_FUNC(isValid, l_ShipTextures, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { object_h *oh; - if(!ade_get_args(L, "o", l_ShipTextures.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_ShipTextures.GetPtr(&oh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", oh->IsValid()); @@ -6349,11 +6349,11 @@ ADE_INDEXER(l_Ship, "string Name/number Index", "Array of ship subsystems", "sub object_h *objh; char *s = NULL; ship_subsys_h *sub; - if(!ade_get_args(L, "o|so", l_Ship.GetPtr(&objh), &s, l_Subsystem.GetPtr(&sub))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|so", l_Ship.GetPtr(&objh), &s, l_Subsystem.GetPtr(&sub))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 ship *shipp = &Ships[objh->objp->instance]; ship_subsys *ss = ship_get_subsys(shipp, s); @@ -6369,15 +6369,15 @@ ADE_INDEXER(l_Ship, "string Name/number Index", "Array of ship subsystems", "sub } if(ss == NULL) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(objh->objp, ss))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(objh->objp, ss))); //-V510 } ADE_FUNC(__len, l_Ship, NULL, "Number of subsystems on ship", "number", "Subsystem number, or 0 if handle is invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid()) @@ -6390,7 +6390,7 @@ ADE_VIRTVAR(Name, l_Ship, "string", "Ship name", "string", "Ship name, or empty { object_h *objh; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Ship.GetPtr(&objh), &s)) + if(!ade_get_args(L, "o|s", l_Ship.GetPtr(&objh), &s)) //-V510 return ade_set_error(L, "s", ""); if(!objh->IsValid()) @@ -6409,7 +6409,7 @@ ADE_VIRTVAR(AfterburnerFuelLeft, l_Ship, "number", "Afterburner fuel left", "num { object_h *objh; float fuel = -1.0f; - if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &fuel)) + if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &fuel)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -6427,7 +6427,7 @@ ADE_VIRTVAR(AfterburnerFuelMax, l_Ship, "number", "Afterburner fuel capacity", " { object_h *objh; float fuel = -1.0f; - if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &fuel)) + if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &fuel)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -6445,11 +6445,11 @@ ADE_VIRTVAR(Class, l_Ship, "shipclass", "Ship class", "shipclass", "Ship class, { object_h *objh; int idx=-1; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_Shipclass.Get(&idx))) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_Shipclass.Get(&idx))) //-V510 + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 ship *shipp = &Ships[objh->objp->instance]; @@ -6457,16 +6457,16 @@ ADE_VIRTVAR(Class, l_Ship, "shipclass", "Ship class", "shipclass", "Ship class, change_ship_type(objh->objp->instance, idx, 1); if(shipp->ship_info_index < 0) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 - return ade_set_args(L, "o", l_Shipclass.Set(shipp->ship_info_index)); + return ade_set_args(L, "o", l_Shipclass.Set(shipp->ship_info_index)); //-V510 } ADE_VIRTVAR(CountermeasuresLeft, l_Ship, "number", "Number of countermeasures left", "number", "Countermeasures left, or 0 if ship handle is invalid") { object_h *objh; int newcm = -1; - if(!ade_get_args(L, "o|i", l_Ship.GetPtr(&objh), &newcm)) + if(!ade_get_args(L, "o|i", l_Ship.GetPtr(&objh), &newcm)) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid()) @@ -6484,11 +6484,11 @@ ADE_VIRTVAR(CountermeasureClass, l_Ship, "weaponclass", "Weapon class mounted on { object_h *objh; int newcm = -1; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_Weaponclass.Get(&newcm))) - return ade_set_error(L, "o", l_Weaponclass.Set(-1));; + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_Weaponclass.Get(&newcm))) //-V510 + return ade_set_error(L, "o", l_Weaponclass.Set(-1));; //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Weaponclass.Set(-1));; + return ade_set_error(L, "o", l_Weaponclass.Set(-1));; //-V510 ship *shipp = &Ships[objh->objp->instance]; @@ -6497,16 +6497,16 @@ ADE_VIRTVAR(CountermeasureClass, l_Ship, "weaponclass", "Weapon class mounted on } if(shipp->current_cmeasure > -1) - return ade_set_args(L, "o", l_Weaponclass.Set(shipp->current_cmeasure)); + return ade_set_args(L, "o", l_Weaponclass.Set(shipp->current_cmeasure)); //-V510 else - return ade_set_error(L, "o", l_Weaponclass.Set(-1));; + return ade_set_error(L, "o", l_Weaponclass.Set(-1));; //-V510 } ADE_VIRTVAR(HitpointsMax, l_Ship, "number", "Total hitpoints", "number", "Ship maximum hitpoints, or 0 if handle is invalid") { object_h *objh; float newhits = -1; - if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &newhits)) + if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &newhits)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -6524,7 +6524,7 @@ ADE_VIRTVAR(WeaponEnergyLeft, l_Ship, "number", "Current weapon energy reserves" { object_h *objh; float neweng = -1; - if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &neweng)) + if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &neweng)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -6542,7 +6542,7 @@ ADE_VIRTVAR(WeaponEnergyMax, l_Ship, "number", "Maximum weapon energy", "number" { object_h *objh; float neweng = -1; - if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &neweng)) + if(!ade_get_args(L, "o|f", l_Ship.GetPtr(&objh), &neweng)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -6560,7 +6560,7 @@ ADE_VIRTVAR(PrimaryTriggerDown, l_Ship, "boolean", "Determines if primary trigge { object_h *objh; bool trig = false; - if(!ade_get_args(L, "o|b", l_Ship.GetPtr(&objh), &trig)) + if(!ade_get_args(L, "o|b", l_Ship.GetPtr(&objh), &trig)) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) @@ -6585,11 +6585,11 @@ ADE_VIRTVAR(PrimaryBanks, l_Ship, "weaponbanktype", "Array of primary weapon ban { object_h *objh; ship_banktype_h *swh; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_WeaponBankType.GetPtr(&swh))) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_WeaponBankType.GetPtr(&swh))) //-V510 + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 ship_weapon *dst = &Ships[objh->objp->instance].weapons; @@ -6609,18 +6609,18 @@ ADE_VIRTVAR(PrimaryBanks, l_Ship, "weaponbanktype", "Array of primary weapon ban memcpy(dst->primary_bank_weapons, src->primary_bank_weapons, sizeof(dst->primary_bank_weapons)); } - return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(objh->objp, dst, SWH_PRIMARY))); + return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(objh->objp, dst, SWH_PRIMARY))); //-V510 } ADE_VIRTVAR(SecondaryBanks, l_Ship, "weaponbanktype", "Array of secondary weapon banks", "weaponbanktype", "Secondary weapon banks, or invalid weaponbanktype handle if ship handle is invalid") { object_h *objh; ship_banktype_h *swh; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_WeaponBankType.GetPtr(&swh))) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_WeaponBankType.GetPtr(&swh))) //-V510 + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 ship_weapon *dst = &Ships[objh->objp->instance].weapons; @@ -6641,18 +6641,18 @@ ADE_VIRTVAR(SecondaryBanks, l_Ship, "weaponbanktype", "Array of secondary weapon memcpy(dst->secondary_next_slot, src->secondary_next_slot, sizeof(dst->secondary_next_slot)); } - return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(objh->objp, dst, SWH_SECONDARY))); + return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(objh->objp, dst, SWH_SECONDARY))); //-V510 } ADE_VIRTVAR(TertiaryBanks, l_Ship, "weaponbanktype", "Array of tertiary weapon banks", "weaponbanktype", "Tertiary weapon banks, or invalid weaponbanktype handle if ship handle is invalid") { object_h *objh; ship_banktype_h *swh; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_WeaponBankType.GetPtr(&swh))) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_WeaponBankType.GetPtr(&swh))) //-V510 + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); + return ade_set_error(L, "o", l_WeaponBankType.Set(ship_banktype_h())); //-V510 ship_weapon *dst = &Ships[objh->objp->instance].weapons; @@ -6669,7 +6669,7 @@ ADE_VIRTVAR(TertiaryBanks, l_Ship, "weaponbanktype", "Array of tertiary weapon b dst->tertiary_bank_start_ammo = src->tertiary_bank_start_ammo; } - return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(objh->objp, dst, SWH_TERTIARY))); + return ade_set_args(L, "o", l_WeaponBankType.Set(ship_banktype_h(objh->objp, dst, SWH_TERTIARY))); //-V510 } ADE_VIRTVAR(Target, l_Ship, "object", "Target of ship. Value may also be a deriviative of the 'object' class, such as 'ship'.", "object", "Target object, or invalid object handle if no target or ship handle is invalid") @@ -6677,17 +6677,17 @@ ADE_VIRTVAR(Target, l_Ship, "object", "Target of ship. Value may also be a deriv object_h *objh; object_h *newh; //WMC - Maybe use two argument return capabilities of Lua to set/return subsystem? - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_Object.GetPtr(&newh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&objh), l_Object.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 ai_info *aip = NULL; if(Ships[objh->objp->instance].ai_index > -1) aip = &Ai_info[Ships[objh->objp->instance].ai_index]; else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR) { @@ -6718,17 +6718,17 @@ ADE_VIRTVAR(TargetSubsystem, l_Ship, "subsystem", "Target subsystem of ship.", " object_h *oh; ship_subsys_h *newh; //WMC - Maybe use two argument return capabilities of Lua to set/return subsystem? - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&oh), l_Subsystem.GetPtr(&newh))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&oh), l_Subsystem.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 ai_info *aip = NULL; if(Ships[oh->objp->instance].ai_index > -1) aip = &Ai_info[Ships[oh->objp->instance].ai_index]; else - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(ADE_SETTING_VAR) { @@ -6752,18 +6752,18 @@ ADE_VIRTVAR(TargetSubsystem, l_Ship, "subsystem", "Target subsystem of ship.", " } } - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(&Objects[aip->target_objnum], aip->targeted_subsys))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(&Objects[aip->target_objnum], aip->targeted_subsys))); //-V510 } ADE_VIRTVAR(Team, l_Ship, "team", "Ship's team", "team", "Ship team, or invalid team handle if ship handle is invalid") { object_h *oh=NULL; int nt=-1; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&oh), l_Team.Get(&nt))) - return ade_set_error(L, "o", l_Team.Set(-1)); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&oh), l_Team.Get(&nt))) //-V510 + return ade_set_error(L, "o", l_Team.Set(-1)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Team.Set(-1)); + return ade_set_error(L, "o", l_Team.Set(-1)); //-V510 ship *shipp = &Ships[oh->objp->instance]; @@ -6771,18 +6771,18 @@ ADE_VIRTVAR(Team, l_Ship, "team", "Ship's team", "team", "Ship team, or invalid shipp->team = nt; } - return ade_set_args(L, "o", l_Team.Set(shipp->team)); + return ade_set_args(L, "o", l_Team.Set(shipp->team)); //-V510 } ADE_VIRTVAR(Textures, l_Ship, "shiptextures", "Gets ship textures", "shiptextures", "Ship textures, or invalid shiptextures handle if ship handle is invalid") { object_h *sh; object_h *dh; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&dh), l_Ship.GetPtr(&sh))) - return ade_set_error(L, "o", l_ShipTextures.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&dh), l_Ship.GetPtr(&sh))) //-V510 + return ade_set_error(L, "o", l_ShipTextures.Set(object_h())); //-V510 if(!dh->IsValid()) - return ade_set_error(L, "o", l_ShipTextures.Set(object_h())); + return ade_set_error(L, "o", l_ShipTextures.Set(object_h())); //-V510 if(ADE_SETTING_VAR && sh != NULL && sh->IsValid()) { ship *src = &Ships[sh->objp->instance]; @@ -6797,7 +6797,7 @@ ADE_VIRTVAR(Textures, l_Ship, "shiptextures", "Gets ship textures", "shiptexture } } - return ade_set_args(L, "o", l_ShipTextures.Set(object_h(dh->objp))); + return ade_set_args(L, "o", l_ShipTextures.Set(object_h(dh->objp))); //-V510 } ADE_VIRTVAR(FlagAffectedByGravity, l_Ship, "boolean", "Checks for the \"affected-by-gravity\" flag", "boolean", "True if flag is set, false if flag is not set and nil on error") @@ -6805,7 +6805,7 @@ ADE_VIRTVAR(FlagAffectedByGravity, l_Ship, "boolean", "Checks for the \"affected object_h *objh=NULL; bool set = false; - if (!ade_get_args(L, "o|b", l_Ship.GetPtr(&objh), &set)) + if (!ade_get_args(L, "o|b", l_Ship.GetPtr(&objh), &set)) //-V510 return ADE_RETURN_NIL; if (!objh->IsValid()) @@ -6829,7 +6829,7 @@ ADE_VIRTVAR(FlagAffectedByGravity, l_Ship, "boolean", "Checks for the \"affected ADE_FUNC(kill, l_Ship, "[object Killer]", "Kills the ship. Set \"Killer\" to the ship you are killing to self-destruct", "boolean", "True if successful, false or nil otherwise") { object_h *victim,*killer=NULL; - if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&victim), l_Ship.GetPtr(&killer))) + if(!ade_get_args(L, "o|o", l_Ship.GetPtr(&victim), l_Ship.GetPtr(&killer))) //-V510 return ADE_RETURN_NIL; if(!victim->IsValid()) @@ -6855,7 +6855,7 @@ ADE_FUNC(addShipEffect, l_Ship, "string name, int duration (in milliseconds)", " int duration; int effect_num; - if (!ade_get_args(L, "o|si", l_Ship.GetPtr(&shiph), &effect, &duration)) + if (!ade_get_args(L, "o|si", l_Ship.GetPtr(&shiph), &effect, &duration)) //-V510 return ade_set_error(L, "b", false); if (!shiph->IsValid()) @@ -6878,7 +6878,7 @@ ADE_FUNC(addShipEffect, l_Ship, "string name, int duration (in milliseconds)", " ADE_FUNC(hasShipExploded, l_Ship, NULL, "Checks if the ship explosion event has already happened", "number", "Returns 1 if first explosion timestamp is passed, 2 if second is passed, 0 otherwise") { object_h *shiph; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&shiph))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&shiph))) //-V510 return ade_set_error(L, "i", 0); if(!shiph->IsValid()) @@ -6902,7 +6902,7 @@ ADE_FUNC(hasShipExploded, l_Ship, NULL, "Checks if the ship explosion event has ADE_FUNC(fireCountermeasure, l_Ship, NULL, "Launches a countermeasure from the ship", "boolean", "Whether countermeasure was launched or not") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ade_set_error(L, "b", false); if(!objh->IsValid()) @@ -6914,7 +6914,7 @@ ADE_FUNC(fireCountermeasure, l_Ship, NULL, "Launches a countermeasure from the s ADE_FUNC(firePrimary, l_Ship, NULL, "Fires ship primary bank(s)", "number", "Number of primary banks fired") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid()) @@ -6930,7 +6930,7 @@ ADE_FUNC(firePrimary, l_Ship, NULL, "Fires ship primary bank(s)", "number", "Num ADE_FUNC(fireSecondary, l_Ship, NULL, "Fires ship secondary bank(s)", "number", "Number of secondary banks fired") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ade_set_error(L, "i", 0); if(!objh->IsValid()) @@ -6944,7 +6944,7 @@ ADE_FUNC(getAnimationDoneTime, l_Ship, "number Type, number Subtype", "Gets time object_h *objh; char *s = NULL; int subtype=-1; - if(!ade_get_args(L, "o|si", l_Ship.GetPtr(&objh), &s, &subtype)) + if(!ade_get_args(L, "o|si", l_Ship.GetPtr(&objh), &s, &subtype)) //-V510 return ade_set_error(L, "f", 0.0f); if(!objh->IsValid()) @@ -6963,7 +6963,7 @@ ADE_FUNC(getAnimationDoneTime, l_Ship, "number Type, number Subtype", "Gets time ADE_FUNC(clearOrders, l_Ship, NULL, "Clears a ship's orders list", "boolean", "True if successful, otherwise false or nil") { object_h *objh = NULL; - if(!ade_get_args(L, "o", l_Object.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Object.GetPtr(&objh))) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) return ade_set_error(L, "b", false); @@ -6981,7 +6981,7 @@ ADE_FUNC(giveOrder, l_Ship, "enumeration Order, [object Target=nil, subsystem Ta float priority = 1.0f; object_h *tgh = NULL; ship_subsys_h *tgsh = NULL; - if(!ade_get_args(L, "oo|oof", l_Object.GetPtr(&objh), l_Enum.GetPtr(&eh), l_Object.GetPtr(&tgh), l_Subsystem.GetPtr(&tgsh), &priority)) + if(!ade_get_args(L, "oo|oof", l_Object.GetPtr(&objh), l_Enum.GetPtr(&eh), l_Object.GetPtr(&tgh), l_Subsystem.GetPtr(&tgsh), &priority)) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid() || !eh->IsValid()) @@ -7204,7 +7204,7 @@ ADE_FUNC(doManeuver, l_Ship, "number Duration, number Heading, number Pitch, num float arr[6]; bool f_rot = false, f_move = false; int t, i; - if(!ade_get_args(L, "oifffbfffb", l_Ship.GetPtr(&objh), &t, &arr[0], &arr[1], &arr[2], &f_rot, &arr[3], &arr[4], &arr[5], &f_move)) + if(!ade_get_args(L, "oifffbfffb", l_Ship.GetPtr(&objh), &t, &arr[0], &arr[1], &arr[2], &f_rot, &arr[3], &arr[4], &arr[5], &f_move)) //-V510 return ADE_RETURN_NIL; ship *shipp = &Ships[objh->objp->instance]; @@ -7274,7 +7274,7 @@ ADE_FUNC(triggerAnimation, l_Ship, "string Type, [number Subtype, boolean Forwar char *s = NULL; bool b = true; int subtype=-1; - if(!ade_get_args(L, "o|sib", l_Ship.GetPtr(&objh), &s, &subtype, &b)) + if(!ade_get_args(L, "o|sib", l_Ship.GetPtr(&objh), &s, &subtype, &b)) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) @@ -7296,7 +7296,7 @@ ADE_FUNC(triggerAnimation, l_Ship, "string Type, [number Subtype, boolean Forwar ADE_FUNC(warpIn, l_Ship, NULL, "Warps ship in", "boolean", "True if successful, or nil if ship handle is invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) @@ -7310,7 +7310,7 @@ ADE_FUNC(warpIn, l_Ship, NULL, "Warps ship in", "boolean", "True if successful, ADE_FUNC(warpOut, l_Ship, NULL, "Warps ship out", "boolean", "True if successful, or nil if ship handle is invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) @@ -7325,7 +7325,7 @@ ADE_FUNC(warpOut, l_Ship, NULL, "Warps ship out", "boolean", "True if successful ADE_FUNC(isWarpingIn, l_Ship, NULL, "Checks if ship is warping in", "boolean", "True if the ship is warping in, false or nil otherwise") { object_h *objh; - if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) //-V510 return ADE_RETURN_NIL; if(!objh->IsValid()) @@ -7344,7 +7344,7 @@ ADE_FUNC(getEMP, l_Ship, NULL, "Returns the current emp effect strength acting o object_h *objh = NULL; object *obj = NULL; - if (!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) { + if (!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) { //-V510 return ADE_RETURN_NIL; } @@ -7365,11 +7365,11 @@ ADE_VIRTVAR(Class, l_Weapon, "weaponclass", "Weapon's class", "weaponclass", "We { object_h *oh=NULL; int nc=-1; - if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&oh), l_Weaponclass.Get(&nc))) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&oh), l_Weaponclass.Get(&nc))) //-V510 + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 weapon *wp = &Weapons[oh->objp->instance]; @@ -7377,7 +7377,7 @@ ADE_VIRTVAR(Class, l_Weapon, "weaponclass", "Weapon's class", "weaponclass", "We wp->weapon_info_index = nc; } - return ade_set_args(L, "o", l_Weaponclass.Set(wp->weapon_info_index)); + return ade_set_args(L, "o", l_Weaponclass.Set(wp->weapon_info_index)); //-V510 } ADE_VIRTVAR(DestroyedByWeapon, l_Weapon, "boolean", "Whether weapon was destroyed by another weapon", "boolean", "True if weapon was destroyed by another weapon, false if weapon was destroyed by another object or if weapon handle is invalid") @@ -7385,7 +7385,7 @@ ADE_VIRTVAR(DestroyedByWeapon, l_Weapon, "boolean", "Whether weapon was destroye object_h *oh=NULL; bool b = false; - int numargs = ade_get_args(L, "o|b", l_Weapon.GetPtr(&oh), &b); + int numargs = ade_get_args(L, "o|b", l_Weapon.GetPtr(&oh), &b); //-V510 if(!numargs) return ade_set_error(L, "b", false); @@ -7409,7 +7409,7 @@ ADE_VIRTVAR(LifeLeft, l_Weapon, "number", "Weapon life left (in seconds)", "numb { object_h *oh=NULL; float nll = -1.0f; - if(!ade_get_args(L, "o|f", l_Weapon.GetPtr(&oh), &nll)) + if(!ade_get_args(L, "o|f", l_Weapon.GetPtr(&oh), &nll)) //-V510 return ade_set_error(L, "f", 0.0f); if(!oh->IsValid()) @@ -7428,7 +7428,7 @@ ADE_VIRTVAR(FlakDetonationRange, l_Weapon, "number", "Range at which flak will d { object_h *oh=NULL; float rng = -1.0f; - if(!ade_get_args(L, "o|f", l_Weapon.GetPtr(&oh), &rng)) + if(!ade_get_args(L, "o|f", l_Weapon.GetPtr(&oh), &rng)) //-V510 return ade_set_error(L, "f", 0.0f); if(!oh->IsValid()) @@ -7447,17 +7447,17 @@ ADE_VIRTVAR(Target, l_Weapon, "object", "Target of weapon. Value may also be a d { object_h *objh; object_h *newh; - if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Object.GetPtr(&newh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Object.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 weapon *wp = NULL; if(objh->objp->instance > -1) wp = &Weapons[objh->objp->instance]; else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7483,17 +7483,17 @@ ADE_VIRTVAR(HomingObject, l_Weapon, "object", "Object that weapon will home in o { object_h *objh; object_h *newh; - if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Object.GetPtr(&newh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Object.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 weapon *wp = NULL; if(objh->objp->instance > -1) wp = &Weapons[objh->objp->instance]; else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7515,7 +7515,7 @@ ADE_VIRTVAR(HomingObject, l_Weapon, "object", "Object that weapon will home in o } if(wp->homing_object == NULL) - return ade_set_args(L, "o", l_Object.Set(object_h())); + return ade_set_args(L, "o", l_Object.Set(object_h())); //-V510 else return ade_set_object_with_breed(L, OBJ_INDEX(wp->homing_object)); } @@ -7524,17 +7524,17 @@ ADE_VIRTVAR(HomingPosition, l_Weapon, "vector", "Position that weapon will home { object_h *objh; vec3d *v3; - if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 weapon *wp = NULL; if(objh->objp->instance > -1) wp = &Weapons[objh->objp->instance]; else - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR) { @@ -7552,24 +7552,24 @@ ADE_VIRTVAR(HomingPosition, l_Weapon, "vector", "Position that weapon will home } } - return ade_set_args(L, "o", l_Vector.Set(wp->homing_pos)); + return ade_set_args(L, "o", l_Vector.Set(wp->homing_pos)); //-V510 } ADE_VIRTVAR(HomingSubsystem, l_Weapon, "subsystem", "Subsystem that weapon will home in on.", "subsystem", "Homing subsystem, or invalid subsystem handle if weapon is not homing or weapon handle is invalid") { object_h *objh; ship_subsys_h *newh; - if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Subsystem.GetPtr(&newh))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&objh), l_Subsystem.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 weapon *wp = NULL; if(objh->objp->instance > -1) wp = &Weapons[objh->objp->instance]; else - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7590,18 +7590,18 @@ ADE_VIRTVAR(HomingSubsystem, l_Weapon, "subsystem", "Subsystem that weapon will } } - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(wp->homing_object, wp->homing_subsys))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(wp->homing_object, wp->homing_subsys))); //-V510 } ADE_VIRTVAR(Team, l_Weapon, "team", "Weapon's team", "team", "Weapon team, or invalid team handle if weapon handle is invalid") { object_h *oh=NULL; int nt=-1; - if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&oh), l_Team.Get(&nt))) - return ade_set_error(L, "o", l_Team.Set(-1)); + if(!ade_get_args(L, "o|o", l_Weapon.GetPtr(&oh), l_Team.Get(&nt))) //-V510 + return ade_set_error(L, "o", l_Team.Set(-1)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Team.Set(-1)); + return ade_set_error(L, "o", l_Team.Set(-1)); //-V510 weapon *wp = &Weapons[oh->objp->instance]; @@ -7609,14 +7609,14 @@ ADE_VIRTVAR(Team, l_Weapon, "team", "Weapon's team", "team", "Weapon team, or in wp->team = nt; } - return ade_set_args(L, "o", l_Team.Set(wp->team)); + return ade_set_args(L, "o", l_Team.Set(wp->team)); //-V510 } ADE_FUNC(isArmed, l_Weapon, "[boolean Hit target]", "Checks if the weapon is armed.", "boolean", "boolean value of the weapon arming status") { object_h *oh = NULL; bool hit_target = false; - if(!ade_get_args(L, "o|b", l_Weapon.GetPtr(&oh), &hit_target)) + if(!ade_get_args(L, "o|b", l_Weapon.GetPtr(&oh), &hit_target)) //-V510 return ADE_RETURN_FALSE; if(!oh->IsValid()) @@ -7633,7 +7633,7 @@ ADE_FUNC(isArmed, l_Weapon, "[boolean Hit target]", "Checks if the weapon is arm ADE_FUNC(getCollisionInformation, l_Weapon, NULL, "Returns the collision information for this weapon", "collision info", "The collision information or invalid handle if none") { object_h *oh=NULL; - if(!ade_get_args(L, "o", l_Weapon.GetPtr(&oh))) + if(!ade_get_args(L, "o", l_Weapon.GetPtr(&oh))) //-V510 return ADE_RETURN_NIL; if(!oh->IsValid()) @@ -7642,9 +7642,9 @@ ADE_FUNC(getCollisionInformation, l_Weapon, NULL, "Returns the collision informa weapon *wp = &Weapons[oh->objp->instance]; if (wp->collisionOccured) - return ade_set_args(L, "o", l_ColInfo.Set(mc_info_h(new mc_info(wp->collisionInfo)))); + return ade_set_args(L, "o", l_ColInfo.Set(mc_info_h(new mc_info(wp->collisionInfo)))); //-V510 else - return ade_set_args(L, "o", l_ColInfo.Set(mc_info_h())); + return ade_set_args(L, "o", l_ColInfo.Set(mc_info_h())); //-V510 } @@ -7655,11 +7655,11 @@ ADE_VIRTVAR(Class, l_Beam, "weaponclass", "Weapon's class", "weaponclass", "Weap { object_h *oh=NULL; int nc=-1; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&oh), l_Weaponclass.Get(&nc))) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&oh), l_Weaponclass.Get(&nc))) //-V510 + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 beam *bp = &Beams[oh->objp->instance]; @@ -7667,18 +7667,18 @@ ADE_VIRTVAR(Class, l_Beam, "weaponclass", "Weapon's class", "weaponclass", "Weap bp->weapon_info_index = nc; } - return ade_set_args(L, "o", l_Weaponclass.Set(bp->weapon_info_index)); + return ade_set_args(L, "o", l_Weaponclass.Set(bp->weapon_info_index)); //-V510 } ADE_VIRTVAR(LastShot, l_Beam, "vector", "End point of the beam", "vector", "vector or null vector if beam handle is not valid") { object_h *oh=NULL; vec3d *vec3; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&oh), l_Vector.GetPtr(&vec3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&oh), l_Vector.GetPtr(&vec3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam *bp = &Beams[oh->objp->instance]; @@ -7686,18 +7686,18 @@ ADE_VIRTVAR(LastShot, l_Beam, "vector", "End point of the beam", "vector", "vect bp->last_shot = *vec3; } - return ade_set_args(L, "o", l_Vector.Set(bp->last_shot)); + return ade_set_args(L, "o", l_Vector.Set(bp->last_shot)); //-V510 } ADE_VIRTVAR(LastStart, l_Beam, "vector", "Start point of the beam", "vector", "vector or null vector if beam handle is not valid") { object_h *oh=NULL; vec3d *v3; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&oh), l_Vector.GetPtr(&v3))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&oh), l_Vector.GetPtr(&v3))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!oh->IsValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam *bp = &Beams[oh->objp->instance]; @@ -7705,24 +7705,24 @@ ADE_VIRTVAR(LastStart, l_Beam, "vector", "Start point of the beam", "vector", "v bp->last_start = *v3; } - return ade_set_args(L, "o", l_Vector.Set(bp->last_start)); + return ade_set_args(L, "o", l_Vector.Set(bp->last_start)); //-V510 } ADE_VIRTVAR(Target, l_Beam, "object", "Target of beam. Value may also be a deriviative of the 'object' class, such as 'ship'.", "object", "Beam target, or invalid object handle if beam handle is invalid") { object_h *objh; object_h *newh; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Object.GetPtr(&newh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Object.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7748,17 +7748,17 @@ ADE_VIRTVAR(TargetSubsystem, l_Beam, "subsystem", "Subsystem that beam is target { object_h *objh; ship_subsys_h *newh; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Subsystem.GetPtr(&newh))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Subsystem.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7778,24 +7778,24 @@ ADE_VIRTVAR(TargetSubsystem, l_Beam, "subsystem", "Subsystem that beam is target } } - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(bp->target, bp->target_subsys))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(bp->target, bp->target_subsys))); //-V510 } ADE_VIRTVAR(ParentShip, l_Beam, "object", "Parent of the beam.", "object", "Beam parent, or invalid object handle if beam handle is invalid") { object_h *objh; object_h *newh; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Object.GetPtr(&newh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Object.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7821,17 +7821,17 @@ ADE_VIRTVAR(ParentSubsystem, l_Beam, "subsystem", "Subsystem that beam is fired { object_h *objh; ship_subsys_h *newh; - if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Subsystem.GetPtr(&newh))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|o", l_Beam.GetPtr(&objh), l_Subsystem.GetPtr(&newh))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!objh->IsValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(ADE_SETTING_VAR) { @@ -7850,13 +7850,13 @@ ADE_VIRTVAR(ParentSubsystem, l_Beam, "subsystem", "Subsystem that beam is fired } } - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(bp->objp, bp->subsys))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(bp->objp, bp->subsys))); //-V510 } ADE_FUNC(getCollisionCount, l_Beam, NULL, "Get the number of collisions in frame.", "number", "Number of beam collisions") { object_h *objh; - if(!ade_get_args(L, "o", l_Beam.GetPtr(&objh))) + if(!ade_get_args(L, "o", l_Beam.GetPtr(&objh))) //-V510 return ADE_RETURN_NIL; beam *bp = NULL; @@ -7872,63 +7872,63 @@ ADE_FUNC(getCollisionPosition, l_Beam, "number", "Get the position of the define { object_h *objh; int idx; - if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 // convert from Lua to C idx--; if ((idx >= MAX_FRAME_COLLISIONS) || (idx < 0)) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 // so we have valid beam and valid indexer - return ade_set_args(L, "o", l_Vector.Set(bp->f_collisions[idx].cinfo.hit_point_world)); + return ade_set_args(L, "o", l_Vector.Set(bp->f_collisions[idx].cinfo.hit_point_world)); //-V510 } ADE_FUNC(getCollisionInformation, l_Beam, "number", "Get the collision information of the specified collision", "collision info", "handle to information or invalid handle on error") { object_h *objh; int idx; - if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) - return ade_set_error(L, "o", l_ColInfo.Set(mc_info_h())); + if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) //-V510 + return ade_set_error(L, "o", l_ColInfo.Set(mc_info_h())); //-V510 // convert from Lua to C idx--; if ((idx >= MAX_FRAME_COLLISIONS) || (idx < 0)) - return ade_set_error(L, "o", l_ColInfo.Set(mc_info_h())); + return ade_set_error(L, "o", l_ColInfo.Set(mc_info_h())); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_ColInfo.Set(mc_info_h())); + return ade_set_error(L, "o", l_ColInfo.Set(mc_info_h())); //-V510 // so we have valid beam and valid indexer - return ade_set_args(L, "o", l_ColInfo.Set(mc_info_h(new mc_info(bp->f_collisions[idx].cinfo)))); + return ade_set_args(L, "o", l_ColInfo.Set(mc_info_h(new mc_info(bp->f_collisions[idx].cinfo)))); //-V510 } ADE_FUNC(getCollisionObject, l_Beam, "number", "Get the target of the defined collision.", "object", "Object the beam collided with") { object_h *objh; int idx; - if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 // convert from Lua to C idx--; if ((idx >= MAX_FRAME_COLLISIONS) || (idx < 0)) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 // so we have valid beam and valid indexer return ade_set_object_with_breed(L, bp->f_collisions[idx].c_objnum); @@ -7938,7 +7938,7 @@ ADE_FUNC(isExitCollision, l_Beam, "number", "Checks if the defined collision was { object_h *objh; int idx; - if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) + if(!ade_get_args(L, "oi", l_Beam.GetPtr(&objh), &idx)) //-V510 return ADE_RETURN_NIL; // convert from Lua to C @@ -7962,35 +7962,35 @@ ADE_FUNC(isExitCollision, l_Beam, "number", "Checks if the defined collision was ADE_FUNC(getStartDirectionInfo, l_Beam, NULL, "Gets the start information about the direction. The vector is a normalized vector from LastStart showing the start direction of a slashing beam", "vector", "The start direction or null vector if invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Beam.GetPtr(&objh))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o", l_Beam.GetPtr(&objh))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam_info inf = bp->binfo; - return ade_set_args(L, "o", l_Vector.Set(inf.dir_a)); + return ade_set_args(L, "o", l_Vector.Set(inf.dir_a)); //-V510 } ADE_FUNC(getEndDirectionInfo, l_Beam, NULL, "Gets the end information about the direction. The vector is a normalized vector from LastStart showing the end direction of a slashing beam", "vector", "The start direction or null vector if invalid") { object_h *objh; - if(!ade_get_args(L, "o", l_Beam.GetPtr(&objh))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o", l_Beam.GetPtr(&objh))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam *bp = NULL; if(objh->objp->instance > -1) bp = &Beams[objh->objp->instance]; else - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 beam_info inf = bp->binfo; - return ade_set_args(L, "o", l_Vector.Set(inf.dir_b)); + return ade_set_args(L, "o", l_Vector.Set(inf.dir_b)); //-V510 } //**********HANDLE: Wing @@ -8001,11 +8001,11 @@ ADE_INDEXER(l_Wing, "number Index", "Array of ships in the wing", "ship", "Ship int wdx; int sdx; object_h *ndx=NULL; - if(!ade_get_args(L, "oi|o", l_Wing.Get(&wdx), &sdx, l_Ship.GetPtr(&ndx))) - return ade_set_error(L, "o", l_Ship.Set(object_h())); + if(!ade_get_args(L, "oi|o", l_Wing.Get(&wdx), &sdx, l_Ship.GetPtr(&ndx))) //-V510 + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 if(sdx < 1 || sdx > Wings[wdx].current_count) { - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 } //Lua-->FS2 @@ -8015,13 +8015,13 @@ ADE_INDEXER(l_Wing, "number Index", "Array of ships in the wing", "ship", "Ship Wings[wdx].ship_index[sdx] = ndx->objp->instance; } - return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[Ships[Wings[wdx].ship_index[sdx]].objnum]))); + return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[Ships[Wings[wdx].ship_index[sdx]].objnum]))); //-V510 } ADE_FUNC(__len, l_Wing, NULL, "Number of wings in mission", "number", "Number of wings in mission") { int wdx; - if(!ade_get_args(L, "o", l_Wing.Get(&wdx))) + if(!ade_get_args(L, "o", l_Wing.Get(&wdx))) //-V510 return ade_set_error(L, "i", NULL); return ade_set_args(L, "i", Wings[wdx].current_count); @@ -8032,7 +8032,7 @@ ade_obj l_Player("player", "Player handle"); ADE_FUNC(isValid, l_Player, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { int idx; - if(!ade_get_args(L, "o", l_Player.Get(&idx))) + if(!ade_get_args(L, "o", l_Player.Get(&idx))) //-V510 return ADE_RETURN_NIL; if(idx < 0 || idx >= Player_num) @@ -8044,7 +8044,7 @@ ADE_FUNC(isValid, l_Player, NULL, "Detects whether handle is valid", "boolean", ADE_FUNC(getName, l_Player, NULL, "Gets current player name", "string", "Player name, or empty string if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Player.Get(&idx))) + if(!ade_get_args(L, "o", l_Player.Get(&idx))) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Player_num) @@ -8056,7 +8056,7 @@ ADE_FUNC(getName, l_Player, NULL, "Gets current player name", "string", "Player ADE_FUNC(getCampaignFilename, l_Player, NULL, "Gets current player campaign filename", "string", "Campaign name, or empty string if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Player.Get(&idx))) + if(!ade_get_args(L, "o", l_Player.Get(&idx))) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Player_num) @@ -8068,7 +8068,7 @@ ADE_FUNC(getCampaignFilename, l_Player, NULL, "Gets current player campaign file ADE_FUNC(getImageFilename, l_Player, NULL, "Gets current player image filename", "string", "Player image filename, or empty string if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Player.Get(&idx))) + if(!ade_get_args(L, "o", l_Player.Get(&idx))) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Player_num) @@ -8081,7 +8081,7 @@ ADE_FUNC(getImageFilename, l_Player, NULL, "Gets current player image filename", ADE_FUNC(getMainHall, l_Player, NULL, "Gets player's main hall number", "number", "Main hall index, or 1 if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Player.Get(&idx))) + if(!ade_get_args(L, "o", l_Player.Get(&idx))) //-V510 return ade_set_error(L, "i", 1); if(idx < 0 || idx >= Player_num) @@ -8096,7 +8096,7 @@ ADE_FUNC(getMainHall, l_Player, NULL, "Gets player's main hall number", "number" ADE_FUNC(getSquadronName, l_Player, NULL, "Gets current player squad name", "string", "Squadron name, or empty string if handle is invalid") { int idx; - if(!ade_get_args(L, "o", l_Player.Get(&idx))) + if(!ade_get_args(L, "o", l_Player.Get(&idx))) //-V510 return ade_set_error(L, "s", ""); if(idx < 0 || idx >= Player_num) @@ -8121,7 +8121,7 @@ ade_obj l_Camera("camera", "Camera handle"); ADE_FUNC(__tostring, l_Camera, NULL, "Camera name", "string", "Camera name, or an empty string if handle is invalid") { camid cid; - if(!ade_get_args(L, "o", l_Camera.Get(&cid))) + if(!ade_get_args(L, "o", l_Camera.Get(&cid))) //-V510 return ade_set_error(L, "s", ""); if(!cid.isValid()) @@ -8133,7 +8133,7 @@ ADE_FUNC(__tostring, l_Camera, NULL, "Camera name", "string", "Camera name, or a ADE_FUNC(isValid, l_Camera, NULL, "True if valid, false or nil if not", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { camid cid; - if(!ade_get_args(L, "o", l_Camera.Get(&cid))) + if(!ade_get_args(L, "o", l_Camera.Get(&cid))) //-V510 return ADE_RETURN_NIL; if(!cid.isValid()) @@ -8146,7 +8146,7 @@ ADE_VIRTVAR(Name, l_Camera, "string", "New camera name", "string", "Camera name" { camid cid; char *s = NULL; - if(!ade_get_args(L, "o|s", l_Camera.Get(&cid), &s)) + if(!ade_get_args(L, "o|s", l_Camera.Get(&cid), &s)) //-V510 return ade_set_error(L, "s", ""); if(!cid.isValid()) @@ -8163,7 +8163,7 @@ ADE_VIRTVAR(FOV, l_Camera, "number", "New camera FOV (in radians)", "number", "C { camid cid; float f = VIEWER_ZOOM_DEFAULT; - if(!ade_get_args(L, "o|f", l_Camera.Get(&cid), &f)) + if(!ade_get_args(L, "o|f", l_Camera.Get(&cid), &f)) //-V510 return ade_set_error(L, "f", 0.0f); if(!cid.isValid()) @@ -8180,7 +8180,7 @@ ADE_VIRTVAR(Orientation, l_Camera, "orientation", "New camera orientation", "ori { camid cid; matrix_h *mh = NULL; - if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Matrix.GetPtr(&mh))) + if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Matrix.GetPtr(&mh))) //-V510 return ade_set_error(L, "f", 0.0f); if(!cid.isValid()) @@ -8192,18 +8192,18 @@ ADE_VIRTVAR(Orientation, l_Camera, "orientation", "New camera orientation", "ori matrix mtx; cid.getCamera()->get_info(NULL, &mtx); - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&mtx))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&mtx))); //-V510 } ADE_VIRTVAR(Position, l_Camera, "vector", "New camera position", "vector", "Camera position") { camid cid; vec3d *pos = NULL; - if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Vector.GetPtr(&pos))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Vector.GetPtr(&pos))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(!cid.isValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if(ADE_SETTING_VAR) { cid.getCamera()->set_position(pos); @@ -8211,35 +8211,35 @@ ADE_VIRTVAR(Position, l_Camera, "vector", "New camera position", "vector", "Came vec3d v = vmd_zero_vector; cid.getCamera()->get_info(&v, NULL); - return ade_set_args(L, "o", l_Vector.Set(v)); + return ade_set_args(L, "o", l_Vector.Set(v)); //-V510 } ADE_VIRTVAR(Self, l_Camera, "object", "New mount object", "object", "Camera object") { camid cid; object_h *oh = NULL; - if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Object.GetPtr(&oh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Object.GetPtr(&oh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!cid.isValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR && oh->IsValid()) { cid.getCamera()->set_object_host(oh->objp); } - return ade_set_args(L, "o", l_Object.Set(object_h(cid.getCamera()->get_object_host()))); + return ade_set_args(L, "o", l_Object.Set(object_h(cid.getCamera()->get_object_host()))); //-V510 } ADE_VIRTVAR(SelfSubsystem, l_Camera, "subsystem", "New mount object subsystem", "subsystem", "Subsystem that the camera is mounted on") { camid cid; ship_subsys_h *sso = NULL; - if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Subsystem.GetPtr(&sso))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Subsystem.GetPtr(&sso))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!cid.isValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(ADE_SETTING_VAR && sso->IsValid()) { cid.getCamera()->set_object_host(sso->objp, sso->ss->system_info->subobj_num); @@ -8247,54 +8247,54 @@ ADE_VIRTVAR(SelfSubsystem, l_Camera, "subsystem", "New mount object subsystem", object *objp = cid.getCamera()->get_object_host(); if(objp == NULL || objp->type != OBJ_SHIP) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 int submodel = cid.getCamera()->get_object_host_submodel(); if(submodel < 0) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 ship *shipp = &Ships[objp->instance]; polymodel *pm = model_get(Ship_info[shipp->ship_info_index].model_num); if(pm == NULL) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 bsp_info *sm = &pm->submodel[submodel]; ship_subsys *ss = ship_get_subsys(shipp, sm->name); if(ss == NULL) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(objp, ss))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(objp, ss))); //-V510 } ADE_VIRTVAR(Target, l_Camera, "object", "New target object", "object", "Camera target object") { camid cid; object_h *oh = NULL; - if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Object.GetPtr(&oh))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Object.GetPtr(&oh))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(!cid.isValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if(ADE_SETTING_VAR && oh->IsValid()) { cid.getCamera()->set_object_target(oh->objp); } - return ade_set_args(L, "o", l_Object.Set(object_h(cid.getCamera()->get_object_target()))); + return ade_set_args(L, "o", l_Object.Set(object_h(cid.getCamera()->get_object_target()))); //-V510 } ADE_VIRTVAR(TargetSubsystem, l_Camera, "subsystem", "New target subsystem", "subsystem", "Subsystem that the camera is pointed at") { camid cid; ship_subsys_h *sso = NULL; - if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Subsystem.GetPtr(&sso))) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + if(!ade_get_args(L, "o|o", l_Camera.Get(&cid), l_Subsystem.GetPtr(&sso))) //-V510 + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(!cid.isValid()) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 if(ADE_SETTING_VAR && sso->IsValid()) { cid.getCamera()->set_object_target(sso->objp, sso->ss->system_info->subobj_num); @@ -8302,26 +8302,26 @@ ADE_VIRTVAR(TargetSubsystem, l_Camera, "subsystem", "New target subsystem", "sub object *objp = cid.getCamera()->get_object_target(); if(objp == NULL || objp->type != OBJ_SHIP) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 int submodel = cid.getCamera()->get_object_target_submodel(); if(submodel < 0) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 ship *shipp = &Ships[objp->instance]; polymodel *pm = model_get(Ship_info[shipp->ship_info_index].model_num); if(pm == NULL) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 bsp_info *sm = &pm->submodel[submodel]; ship_subsys *ss = ship_get_subsys(shipp, sm->name); if(ss == NULL) - return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); + return ade_set_error(L, "o", l_Subsystem.Set(ship_subsys_h())); //-V510 - return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(objp, ss))); + return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(objp, ss))); //-V510 } ADE_FUNC(setFOV, l_Camera, "[number FOV, number Zoom Time, number Zoom Acceleration Time, number Zoom deceleration Time]", @@ -8337,7 +8337,7 @@ ADE_FUNC(setFOV, l_Camera, "[number FOV, number Zoom Time, number Zoom Accelerat float time=0.0f; float acc_time=0.0f; float dec_time=0.0f; - if(!ade_get_args(L, "o|ffff", l_Camera.Get(&cid), &n_fov, &time, &acc_time, &dec_time)) + if(!ade_get_args(L, "o|ffff", l_Camera.Get(&cid), &n_fov, &time, &acc_time, &dec_time)) //-V510 return ADE_RETURN_NIL; if(!cid.isValid()) @@ -8361,7 +8361,7 @@ ADE_FUNC(setOrientation, l_Camera, "[world orientation Orientation, number Rotat float time=0.0f; float acc_time=0.0f; float dec_time=0.0f; - if(!ade_get_args(L, "o|offf", l_Camera.Get(&cid), l_Matrix.GetPtr(&mh), &time, &acc_time, &dec_time)) + if(!ade_get_args(L, "o|offf", l_Camera.Get(&cid), l_Matrix.GetPtr(&mh), &time, &acc_time, &dec_time)) //-V510 return ADE_RETURN_NIL; if(!cid.isValid()) @@ -8394,7 +8394,7 @@ ADE_FUNC(setPosition, l_Camera, "[wvector Position, number Translation Time, num float time=0.0f; float acc_time=0.0f; float dec_time=0.0f; - if(!ade_get_args(L, "o|offf", l_Camera.Get(&cid), l_Vector.GetPtr(&pos), &time, &acc_time, &dec_time)) + if(!ade_get_args(L, "o|offf", l_Camera.Get(&cid), l_Vector.GetPtr(&pos), &time, &acc_time, &dec_time)) //-V510 return ADE_RETURN_NIL; if(!cid.isValid()) @@ -8425,7 +8425,7 @@ ade_obj l_SoundEntry("soundentry", "sounds.tbl table entry handle ADE_FUNC(isValid, l_SoundEntry, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { sound_entry_h *seh; - if(!ade_get_args(L, "o", l_SoundEntry.GetPtr(&seh))) + if(!ade_get_args(L, "o", l_SoundEntry.GetPtr(&seh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", seh->IsValid()); @@ -8455,7 +8455,7 @@ ADE_VIRTVAR(Pitch, l_Sound, "number", "Panning of sound, from 100 to 100000", "n { sound_h *sh; int newpitch = 100; - if(!ade_get_args(L, "o|i", l_Sound.GetPtr(&sh), &newpitch)) + if(!ade_get_args(L, "o|i", l_Sound.GetPtr(&sh), &newpitch)) //-V510 return ade_set_error(L, "f", 0.0f); if(ADE_SETTING_VAR) @@ -8474,7 +8474,7 @@ ADE_VIRTVAR(Pitch, l_Sound, "number", "Panning of sound, from 100 to 100000", "n ADE_FUNC(isValid, l_Sound, NULL, "Detects whether handle is valid", "boolean", "true if valid, false if handle is invalid, nil if a syntax/type error occurs") { sound_h *sh; - if(!ade_get_args(L, "o", l_Sound.GetPtr(&sh))) + if(!ade_get_args(L, "o", l_Sound.GetPtr(&sh))) //-V510 return ADE_RETURN_NIL; return ade_set_args(L, "b", sh->IsValid()); @@ -8488,7 +8488,7 @@ ADE_VIRTVAR(Pitch, l_Control_Info, "number", "Pitch of the player ship", "number int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8503,7 +8503,7 @@ ADE_VIRTVAR(Heading, l_Control_Info, "number", "Heading of the player ship", "nu int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8518,7 +8518,7 @@ ADE_VIRTVAR(Bank, l_Control_Info, "number", "Bank of the player ship", "number", int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8533,7 +8533,7 @@ ADE_VIRTVAR(Vertical, l_Control_Info, "number", "Vertical control of the player int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8548,7 +8548,7 @@ ADE_VIRTVAR(Sideways, l_Control_Info, "number", "Sideways control of the player int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8563,7 +8563,7 @@ ADE_VIRTVAR(Forward, l_Control_Info, "number", "Forward control of the player sh int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8578,7 +8578,7 @@ ADE_VIRTVAR(ForwardCruise, l_Control_Info, "number", "Forward control of the pla int idx; float new_ci = 0.0f; - if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) + if(!ade_get_args(L, "o|f", l_Control_Info.Get(&idx), &new_ci)) //-V510 return ade_set_error(L, "f", new_ci); if(ADE_SETTING_VAR) { @@ -8593,7 +8593,7 @@ ADE_VIRTVAR(PrimaryCount, l_Control_Info, "number", "Number of primary weapons t int idx; int new_pri = 0; - if(!ade_get_args(L, "o|i", l_Control_Info.Get(&idx), &new_pri)) + if(!ade_get_args(L, "o|i", l_Control_Info.Get(&idx), &new_pri)) //-V510 return ade_set_error(L, "i", new_pri); if(ADE_SETTING_VAR) { @@ -8608,7 +8608,7 @@ ADE_VIRTVAR(SecondaryCount, l_Control_Info, "number", "Number of secondary weapo int idx; int new_sec = 0; - if(!ade_get_args(L, "o|i", l_Control_Info.Get(&idx), &new_sec)) + if(!ade_get_args(L, "o|i", l_Control_Info.Get(&idx), &new_sec)) //-V510 return ade_set_error(L, "i", new_sec); if(ADE_SETTING_VAR) { @@ -8623,7 +8623,7 @@ ADE_VIRTVAR(CountermeasureCount, l_Control_Info, "number", "Number of countermea int idx; int new_cm = 0; - if(!ade_get_args(L, "o|i", l_Control_Info.Get(&idx), &new_cm)) + if(!ade_get_args(L, "o|i", l_Control_Info.Get(&idx), &new_cm)) //-V510 return ade_set_error(L, "i", new_cm); if(ADE_SETTING_VAR) { @@ -8742,7 +8742,7 @@ ADE_VIRTVAR(AllButtonPolling, l_Control_Info, "boolean", "Toggles the all button bool p; int idx; - if(!ade_get_args(L, "o|b", l_Control_Info.Get(&idx), &p)) + if(!ade_get_args(L, "o|b", l_Control_Info.Get(&idx), &p)) //-V510 return ADE_RETURN_FALSE; if (ADE_SETTING_VAR) { @@ -8815,49 +8815,49 @@ ADE_VIRTVAR(Position, l_Particle, "vector", "The current position of the particl { particle_h *ph = NULL; vec3d newVec = vmd_zero_vector; - if (!ade_get_args(L, "o|o", l_Particle.GetPtr(&ph), l_Vector.Get(&newVec))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if (!ade_get_args(L, "o|o", l_Particle.GetPtr(&ph), l_Vector.Get(&newVec))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if (ph == NULL) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if (!ph->isValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if (ADE_SETTING_VAR) { ph->Get()->pos = newVec; } - return ade_set_args(L, "o", l_Vector.Set(ph->Get()->pos)); + return ade_set_args(L, "o", l_Vector.Set(ph->Get()->pos)); //-V510 } ADE_VIRTVAR(Velocity, l_Particle, "vector", "The current velocity of the particle (world vector)", "vector", "The current velocity") { particle_h *ph = NULL; vec3d newVec = vmd_zero_vector; - if (!ade_get_args(L, "o|o", l_Particle.GetPtr(&ph), l_Vector.Get(&newVec))) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + if (!ade_get_args(L, "o|o", l_Particle.GetPtr(&ph), l_Vector.Get(&newVec))) //-V510 + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if (ph == NULL) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if (!ph->isValid()) - return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); + return ade_set_error(L, "o", l_Vector.Set(vmd_zero_vector)); //-V510 if (ADE_SETTING_VAR) { ph->Get()->velocity = newVec; } - return ade_set_args(L, "o", l_Vector.Set(ph->Get()->velocity)); + return ade_set_args(L, "o", l_Vector.Set(ph->Get()->velocity)); //-V510 } ADE_VIRTVAR(Age, l_Particle, "number", "The time this particle already lives", "number", "The current age or -1 on error") { particle_h *ph = NULL; float newAge = -1.0f; - if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newAge)) + if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newAge)) //-V510 return ade_set_error(L, "f", -1.0f); if (ph == NULL) @@ -8879,7 +8879,7 @@ ADE_VIRTVAR(MaximumLife, l_Particle, "number", "The time this particle can live" { particle_h *ph = NULL; float newLife = -1.0f; - if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newLife)) + if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newLife)) //-V510 return ade_set_error(L, "f", -1.0f); if (ph == NULL) @@ -8901,7 +8901,7 @@ ADE_VIRTVAR(Radius, l_Particle, "number", "The radius of the particle", "number" { particle_h *ph = NULL; float newRadius = -1.0f; - if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newRadius)) + if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newRadius)) //-V510 return ade_set_error(L, "f", -1.0f); if (ph == NULL) @@ -8923,7 +8923,7 @@ ADE_VIRTVAR(TracerLength, l_Particle, "number", "The tracer legth of the particl { particle_h *ph = NULL; float newTracer = -1.0f; - if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newTracer)) + if (!ade_get_args(L, "o|f", l_Particle.GetPtr(&ph), &newTracer)) //-V510 return ade_set_error(L, "f", -1.0f); if (ph == NULL) @@ -8945,14 +8945,14 @@ ADE_VIRTVAR(AttachedObject, l_Particle, "object", "The object this particle is a { particle_h *ph = NULL; object_h *newObj; - if (!ade_get_args(L, "o|o", l_Particle.GetPtr(&ph), l_Object.GetPtr(&newObj))) - return ade_set_error(L, "o", l_Object.Set(object_h())); + if (!ade_get_args(L, "o|o", l_Particle.GetPtr(&ph), l_Object.GetPtr(&newObj))) //-V510 + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if (ph == NULL) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if (!ph->isValid()) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 if (ADE_SETTING_VAR) { @@ -8960,13 +8960,13 @@ ADE_VIRTVAR(AttachedObject, l_Particle, "object", "The object this particle is a ph->Get()->attached_objnum = newObj->objp->signature; } - return ade_set_args(L, "o", l_Object.Set(object_h(&Objects[ph->Get()->attached_objnum]))); + return ade_set_args(L, "o", l_Object.Set(object_h(&Objects[ph->Get()->attached_objnum]))); //-V510 } ADE_FUNC(isValid, l_Particle, NULL, "Detects whether this handle is valid", "boolean", "true if valid false if not") { particle_h *ph = NULL; - if (!ade_get_args(L, "o", l_Particle.GetPtr(&ph))) + if (!ade_get_args(L, "o", l_Particle.GetPtr(&ph))) //-V510 return ADE_RETURN_FALSE; if (ph == NULL) @@ -9081,19 +9081,19 @@ ADE_FUNC(createOrientation, l_Base, "[p/r1c1, b/r1c2, h/r1c3, r2c1, r2c2, r2c3, int numargs = ade_get_args(L, "|fffffffff", &m.a1d[0], &m.a1d[1], &m.a1d[2], &m.a1d[3], &m.a1d[4], &m.a1d[5], &m.a1d[6], &m.a1d[7], &m.a1d[8]); if(!numargs) { - return ade_set_args(L, "o", l_Matrix.Set( matrix_h(&vmd_identity_matrix) )); + return ade_set_args(L, "o", l_Matrix.Set( matrix_h(&vmd_identity_matrix) )); //-V510 } else if(numargs == 3) { angles a = {m.a1d[0], m.a1d[1], m.a1d[2]}; - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&a))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&a))); //-V510 } else if(numargs == 9) { - return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&m))); + return ade_set_args(L, "o", l_Matrix.Set(matrix_h(&m))); //-V510 } - return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); + return ade_set_error(L, "o", l_Matrix.Set(matrix_h())); //-V510 } ADE_FUNC(createVector, l_Base, "[x, y, z]", "Creates a vector object", "vector", "Vector object") @@ -9101,7 +9101,7 @@ ADE_FUNC(createVector, l_Base, "[x, y, z]", "Creates a vector object", "vector", vec3d v3 = vmd_zero_vector; ade_get_args(L, "|fff", &v3.xyz.x, &v3.xyz.y, &v3.xyz.z); - return ade_set_args(L, "o", l_Vector.Set(v3)); + return ade_set_args(L, "o", l_Vector.Set(v3)); //-V510 } ADE_FUNC(getFrametime, l_Base, "[Do not adjust for time compression (Boolean)]", "Gets how long this frame is calculated to take. Use it to for animations, physics, etc to make incremental changes.", "number", "Frame time (seconds)") @@ -9118,9 +9118,9 @@ ADE_FUNC(getCurrentGameState, l_Base, "[Depth (number)]", "Gets current FreeSpac ade_get_args(L, "|i", &depth); if(depth > gameseq_get_depth()) - return ade_set_args(L, "o", l_GameState.Set(gamestate_h())); + return ade_set_args(L, "o", l_GameState.Set(gamestate_h())); //-V510 - return ade_set_args(L, "o", l_GameState.Set(gamestate_h(gameseq_get_state(depth)))); + return ade_set_args(L, "o", l_GameState.Set(gamestate_h(gameseq_get_state(depth)))); //-V510 } ADE_FUNC(getCurrentMPStatus, l_Base, "NIL", "Gets this computers current MP status", "string", "Current MP status" ) @@ -9143,7 +9143,7 @@ ADE_FUNC(getCurrentMPStatus, l_Base, "NIL", "Gets this computers current MP stat ADE_FUNC(setControlMode, l_Base, "NIL or enumeration LE_*_CONTROL", "Sets the current control mode for the game.", "string", "Current control mode") { enum_h *e = NULL; - if (!(ade_get_args(L, "|o", l_Enum.GetPtr(&e)))) { + if (!(ade_get_args(L, "|o", l_Enum.GetPtr(&e)))) { //-V510 if (lua_game_control & LGC_NORMAL) return ade_set_args(L, "s", "NORMAL"); else if (lua_game_control & LGC_STEERING) @@ -9175,7 +9175,7 @@ ADE_FUNC(setControlMode, l_Base, "NIL or enumeration LE_*_CONTROL", "Sets the cu ADE_FUNC(setButtonControlMode, l_Base, "NIL or enumeration LE_*_BUTTON_CONTROL", "Sets the current control mode for the game.", "string", "Current control mode") { enum_h *e = NULL; - if (!(ade_get_args(L, "|o", l_Enum.GetPtr(&e)))) { + if (!(ade_get_args(L, "|o", l_Enum.GetPtr(&e)))) { //-V510 if (lua_game_control & LGC_B_NORMAL) return ade_set_args(L, "s", "NORMAL"); else if (lua_game_control & LGC_B_OVERRIDE) @@ -9206,13 +9206,13 @@ ADE_FUNC(setButtonControlMode, l_Base, "NIL or enumeration LE_*_BUTTON_CONTROL", ADE_FUNC(getControlInfo, l_Base, NULL, "Gets the control info handle.", "control info", "control info handle") { - return ade_set_args(L, "o", l_Control_Info.Set(1)); + return ade_set_args(L, "o", l_Control_Info.Set(1)); //-V510 } ADE_FUNC(postGameEvent, l_Base, "gameevent Event", "Sets current game event. Note that you can crash FreeSpace 2 by posting an event at an improper time, so test extensively if you use it.", "boolean", "True if event was posted, false if passed event was invalid") { gameevent_h *gh = NULL; - if(!ade_get_args(L, "o", l_GameEvent.GetPtr(&gh))) + if(!ade_get_args(L, "o", l_GameEvent.GetPtr(&gh))) //-V510 return ade_set_error(L, "b", false); if(!gh->IsValid()) @@ -9234,7 +9234,7 @@ ADE_INDEXER(l_Base_Events, "number Index/string Name", "Array of game events", " { char *name; if(!ade_get_args(L, "*s", &name)) - return ade_set_error(L, "o", l_GameEvent.Set(gameevent_h())); + return ade_set_error(L, "o", l_GameEvent.Set(gameevent_h())); //-V510 int idx = gameseq_get_event_idx(name); @@ -9246,10 +9246,10 @@ ADE_INDEXER(l_Base_Events, "number Index/string Name", "Array of game events", " idx--; if(idx < 0 || idx >= Num_gs_event_text) - return ade_set_error(L, "o", l_GameEvent.Set(gameevent_h())); + return ade_set_error(L, "o", l_GameEvent.Set(gameevent_h())); //-V510 } - return ade_set_args(L, "o", l_GameEvent.Set(gameevent_h(idx))); + return ade_set_args(L, "o", l_GameEvent.Set(gameevent_h(idx))); //-V510 } ADE_FUNC(__len, l_Base_Events, NULL, "Number of events", "number", "Number of events") @@ -9264,7 +9264,7 @@ ADE_INDEXER(l_Base_States, "number Index/string Name", "Array of game states", " { char *name; if(!ade_get_args(L, "*s", &name)) - return ade_set_error(L, "o", l_GameState.Set(gamestate_h())); + return ade_set_error(L, "o", l_GameState.Set(gamestate_h())); //-V510 int idx = gameseq_get_state_idx(name); @@ -9276,10 +9276,10 @@ ADE_INDEXER(l_Base_States, "number Index/string Name", "Array of game states", " idx--; if(idx < 0 || idx >= Num_gs_state_text) - return ade_set_error(L, "o", l_GameState.Set(gamestate_h())); + return ade_set_error(L, "o", l_GameState.Set(gamestate_h())); //-V510 } - return ade_set_args(L, "o", l_GameState.Set(gamestate_h(idx))); + return ade_set_args(L, "o", l_GameState.Set(gamestate_h(idx))); //-V510 } ADE_FUNC(__len, l_Base_States, NULL, "Number of states", "number", "Number of states") @@ -9383,7 +9383,7 @@ ADE_FUNC(openFile, l_CFile, "string Filename, [string Mode=\"r\", string Path = char *n_mode = "r"; char *n_path = ""; if(!ade_get_args(L, "s|ss", &n_filename, &n_mode, &n_path)) - return ade_set_error(L, "o", l_File.Set(NULL)); + return ade_set_error(L, "o", l_File.Set(NULL)); //-V510 int type = CFILE_NORMAL; @@ -9392,19 +9392,19 @@ ADE_FUNC(openFile, l_CFile, "string Filename, [string Mode=\"r\", string Path = path = l_cf_get_path_id(n_path); if(path == CF_TYPE_INVALID) - return ade_set_error(L, "o", l_File.Set(NULL)); + return ade_set_error(L, "o", l_File.Set(NULL)); //-V510 CFILE *cfp = cfopen(n_filename, n_mode, type, path); if(!cf_is_valid(cfp)) - return ade_set_error(L, "o", l_File.Set(NULL)); + return ade_set_error(L, "o", l_File.Set(NULL)); //-V510 - return ade_set_args(L, "o", l_File.Set(cfp)); + return ade_set_args(L, "o", l_File.Set(cfp)); //-V510 } ADE_FUNC(openTempFile, l_CFile, NULL, "Opens a temp file that is automatically deleted when closed", "file", "File handle, or invalid file handle if tempfile couldn't be created") { - return ade_set_args(L, "o", l_File.Set(ctmpfile())); + return ade_set_args(L, "o", l_File.Set(ctmpfile())); //-V510 } ADE_FUNC(renameFile, l_CFile, "string CurrentFilename, string NewFilename, string Path", "Renames given file. Path must be specified. Use a slash for the root directory.", "boolean", "True if file was renamed, otherwise false") @@ -9460,7 +9460,7 @@ ADE_FUNC(isMouseButtonDown, l_Mouse, "{MOUSE_*_BUTTON enumeration}, [..., ...]", return ade_set_error(L, "b", false); enum_h *e[3] = {NULL, NULL, NULL}; - ade_get_args(L, "o|oo", l_Enum.GetPtr(&e[0]), l_Enum.GetPtr(&e[1]), l_Enum.GetPtr(&e[2])); //Like a snake! + ade_get_args(L, "o|oo", l_Enum.GetPtr(&e[0]), l_Enum.GetPtr(&e[1]), l_Enum.GetPtr(&e[2])); //Like a snake! //-V510 bool rtn = false; int check_flags = 0; @@ -9491,7 +9491,7 @@ ADE_FUNC(setCursorImage, l_Mouse, "Image filename, [LOCK or UNLOCK]", "Sets mous char *s = NULL; enum_h *u = NULL; - if(!ade_get_args(L, "s|o", &s, l_Enum.GetPtr(&u))) + if(!ade_get_args(L, "s|o", &s, l_Enum.GetPtr(&u))) //-V510 return ADE_RETURN_NIL; int ul = 0; @@ -9704,7 +9704,7 @@ ADE_FUNC(getHUDGaugeHandle, l_HUD, "string Name", "Returns a handle to a specifi if (gauge == NULL) return ADE_RETURN_NIL; else - return ade_set_args(L, "o", l_HudGauge.Set(*gauge)); + return ade_set_args(L, "o", l_HudGauge.Set(*gauge)); //-V510 } //**********LIBRARY: Graphics @@ -9717,7 +9717,7 @@ ADE_INDEXER(l_Graphics_Cameras, "number Index/string Name", "Gets camera", "came { char *s = NULL; if(!ade_get_args(L, "*s", &s)) - return ade_set_error(L, "o", l_Camera.Set(camid())); + return ade_set_error(L, "o", l_Camera.Set(camid())); //-V510 camid cid = cam_lookup(s); if(!cid.isValid()) @@ -9731,7 +9731,7 @@ ADE_INDEXER(l_Graphics_Cameras, "number Index/string Name", "Gets camera", "came } } - return ade_set_args(L, "o", l_Camera.Set(cid)); + return ade_set_args(L, "o", l_Camera.Set(cid)); //-V510 } ADE_FUNC(__len, l_Graphics_Cameras, NULL, "Gets number of cameras", "number", "Number of cameras") @@ -9752,28 +9752,28 @@ ADE_INDEXER(l_Graphics_Fonts, "number Index/string Filename", "Array of loaded f char *s = NULL; if(!ade_get_args(L, "*s", &s)) - return ade_set_error(L, "o", l_Font.Set(-1)); + return ade_set_error(L, "o", l_Font.Set(-1)); //-V510 int fn = gr_get_fontnum(s); if(fn < 0) { fn = atoi(s); if(fn < 1 || fn > Num_fonts) - return ade_set_error(L, "o", l_Font.Set(-1)); + return ade_set_error(L, "o", l_Font.Set(-1)); //-V510 //Lua->FS2 fn--; } - return ade_set_args(L, "o", l_Font.Set(fn)); + return ade_set_args(L, "o", l_Font.Set(fn)); //-V510 } ADE_VIRTVAR(CurrentFont, l_Graphics, "font", "Current font", "font", NULL) { int newfn = -1; - if(!ade_get_args(L, "*|o", l_Font.Get(&newfn))) - return ade_set_error(L, "o", l_Font.Set(-1)); + if(!ade_get_args(L, "*|o", l_Font.Get(&newfn))) //-V510 + return ade_set_error(L, "o", l_Font.Set(-1)); //-V510 if(ADE_SETTING_VAR && newfn < Num_fonts) { gr_set_font(newfn); @@ -9782,16 +9782,16 @@ ADE_VIRTVAR(CurrentFont, l_Graphics, "font", "Current font", "font", NULL) int fn = gr_get_current_fontnum(); if(fn < 0 || fn > Num_fonts) - return ade_set_error(L, "o", l_Font.Set(-1)); + return ade_set_error(L, "o", l_Font.Set(-1)); //-V510 - return ade_set_args(L, "o", l_Font.Set(fn)); + return ade_set_args(L, "o", l_Font.Set(fn)); //-V510 } ADE_VIRTVAR(CurrentOpacityType, l_Graphics, "enumeration", "Current alpha blending type; uses ALPHABLEND_* enumerations", "enumeration", NULL) { enum_h *alphatype = NULL; - if(!ade_get_args(L, "*|o", l_Enum.GetPtr(&alphatype))) + if(!ade_get_args(L, "*|o", l_Enum.GetPtr(&alphatype))) //-V510 return ADE_RETURN_NIL; if(ADE_SETTING_VAR) @@ -9812,7 +9812,7 @@ ADE_VIRTVAR(CurrentOpacityType, l_Graphics, "enumeration", "Current alpha blendi rtn = LE_ALPHABLEND_NONE; } - return ade_set_args(L, "o", l_Enum.Set(rtn)); + return ade_set_args(L, "o", l_Enum.Set(rtn)); //-V510 } ADE_VIRTVAR(CurrentRenderTarget, l_Graphics, "texture", "Current rendering target", "texture", "Current rendering target, or invalid texture handle if screen is render target") @@ -9822,13 +9822,13 @@ ADE_VIRTVAR(CurrentRenderTarget, l_Graphics, "texture", "Current rendering targe if(ADE_SETTING_VAR && lua_isnil(L, 2)) { bm_set_render_target(-1); - return ade_set_args(L, "o", l_Texture.Set(gr_screen.rendering_to_texture)); + return ade_set_args(L, "o", l_Texture.Set(gr_screen.rendering_to_texture)); //-V510 } else { - if(!ade_get_args(L, "*|o", l_Texture.Get(&newtx))) - return ade_set_error(L, "o", l_Texture.Set(-1)); + if(!ade_get_args(L, "*|o", l_Texture.Get(&newtx))) //-V510 + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 if(ADE_SETTING_VAR) { if(newtx > -1 && bm_is_valid(newtx)) @@ -9837,7 +9837,7 @@ ADE_VIRTVAR(CurrentRenderTarget, l_Graphics, "texture", "Current rendering targe bm_set_render_target(-1); } - return ade_set_args(L, "o", l_Texture.Set(gr_screen.rendering_to_texture)); + return ade_set_args(L, "o", l_Texture.Set(gr_screen.rendering_to_texture)); //-V510 } } @@ -9876,7 +9876,7 @@ ADE_FUNC(createCamera, l_Graphics, char *s = NULL; vec3d *v = &vmd_zero_vector; matrix_h *mh = NULL; - if(!ade_get_args(L, "s|oo", &s, l_Vector.GetPtr(&v), l_Matrix.GetPtr(&mh))) + if(!ade_get_args(L, "s|oo", &s, l_Vector.GetPtr(&v), l_Matrix.GetPtr(&mh))) //-V510 return ADE_RETURN_NIL; matrix *mtx = &vmd_identity_matrix; @@ -9885,7 +9885,7 @@ ADE_FUNC(createCamera, l_Graphics, camid cid = cam_create(s, v, mtx); //Set position - return ade_set_args(L, "o", l_Camera.Set(cid)); + return ade_set_args(L, "o", l_Camera.Set(cid)); //-V510 } ADE_FUNC(getScreenWidth, l_Graphics, NULL, "Gets screen width", "number", "Width in pixels, or 0 if graphics are not initialized yet") @@ -9937,7 +9937,7 @@ ADE_FUNC(getVectorFromCoords, l_Graphics, vm_vec_add2(&pos, &View_position); - return ade_set_args(L, "o", l_Vector.Set(pos)); + return ade_set_args(L, "o", l_Vector.Set(pos)); //-V510 } ADE_FUNC(setTarget, l_Graphics, "[texture Texture]", @@ -9950,7 +9950,7 @@ ADE_FUNC(setTarget, l_Graphics, "[texture Texture]", return ade_set_error(L, "b", false); int idx = -1; - ade_get_args(L, "|o", l_Texture.Get(&idx)); + ade_get_args(L, "|o", l_Texture.Get(&idx)); //-V510 int i = bm_set_render_target(idx, 0); @@ -9960,7 +9960,7 @@ ADE_FUNC(setTarget, l_Graphics, "[texture Texture]", ADE_FUNC(setCamera, l_Graphics, "[camera handle Camera]", "Sets current camera, or resets camera if none specified", "boolean", "true if successful, false or nil otherwise") { camid cid; - if(!ade_get_args(L, "|o", l_Camera.Get(&cid))) + if(!ade_get_args(L, "|o", l_Camera.Get(&cid))) //-V510 { cam_reset_camera(); return ADE_RETURN_NIL; @@ -10076,7 +10076,7 @@ ADE_FUNC(drawPolygon, l_Graphics, "texture Texture, [vector Position={0,0,0}, or matrix_h *mh = NULL; float width = 1.0f; float height = 1.0f; - if(!ade_get_args(L, "o|ooff", l_Texture.Get(&tdx), l_Vector.Get(&pos), l_Matrix.GetPtr(&mh), &width, &height)) + if(!ade_get_args(L, "o|ooff", l_Texture.Get(&tdx), l_Vector.Get(&pos), l_Matrix.GetPtr(&mh), &width, &height)) //-V510 return ADE_RETURN_NIL; if(!bm_is_valid(tdx)) @@ -10130,7 +10130,7 @@ ADE_FUNC(drawSphere, l_Graphics, "[number Radius = 1.0, vector Position]", "Draw { float rad = 1.0f; vec3d pos = vmd_zero_vector; - ade_get_args(L, "|fo", &rad, l_Vector.Get(&pos)); + ade_get_args(L, "|fo", &rad, l_Vector.Get(&pos)); //-V510 bool in_frame = g3_in_frame() > 0; if(!in_frame) @@ -10153,7 +10153,7 @@ ADE_FUNC(drawModel, l_Graphics, "model, position, orientation", "Draws the given model_h *mdl = NULL; vec3d *v = &vmd_zero_vector; matrix_h *mh = NULL; - if(!ade_get_args(L, "ooo", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v), l_Matrix.GetPtr(&mh))) + if(!ade_get_args(L, "ooo", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v), l_Matrix.GetPtr(&mh))) //-V510 return ade_set_args(L, "i", 1); if(mdl == NULL) @@ -10215,7 +10215,7 @@ ADE_FUNC(drawModelOOR, l_Graphics, "model Model, vector Position, matrix Orienta vec3d *v = &vmd_zero_vector; matrix_h *mh = NULL; int flags = MR_NORMAL; - if(!ade_get_args(L, "ooo|i", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v), l_Matrix.GetPtr(&mh), &flags)) + if(!ade_get_args(L, "ooo|i", l_Model.GetPtr(&mdl), l_Vector.GetPtr(&v), l_Matrix.GetPtr(&mh), &flags)) //-V510 return ade_set_args(L, "i", 1); if(mdl == NULL) @@ -10255,7 +10255,7 @@ ADE_FUNC(drawTargetingBrackets, l_Graphics, "object Object, [boolean draw=true, bool draw_box = true; int padding = 5; - if( !ade_get_args(L, "o|bi", l_Object.GetPtr(&objh), &draw_box, &padding) ) { + if( !ade_get_args(L, "o|bi", l_Object.GetPtr(&objh), &draw_box, &padding) ) { //-V510 return ADE_RETURN_NIL; } @@ -10454,7 +10454,7 @@ ADE_FUNC(createTexture, l_Graphics, "[number Width=512, number Height=512, enume enum_h *e = NULL; //GET ARGS - ade_get_args(L, "|iio", &w, &h, l_Enum.GetPtr(&e)); + ade_get_args(L, "|iio", &w, &h, l_Enum.GetPtr(&e)); //-V510 int t = BMP_FLAG_RENDER_TARGET_DYNAMIC; if(e != NULL) @@ -10468,9 +10468,9 @@ ADE_FUNC(createTexture, l_Graphics, "[number Width=512, number Height=512, enume int idx = bm_make_render_target(w, h, t); if(idx < 0) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 - return ade_set_args(L, "o", l_Texture.Set(idx)); + return ade_set_args(L, "o", l_Texture.Set(idx)); //-V510 } ADE_FUNC(loadTexture, l_Graphics, "string Filename, [boolean LoadIfAnimation, boolean NoDropFrames]", @@ -10487,7 +10487,7 @@ ADE_FUNC(loadTexture, l_Graphics, "string Filename, [boolean LoadIfAnimation, bo bool d=false; if(!ade_get_args(L, "s|bb", &s, &b, &d)) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 idx = bm_load(s); if(idx < 0 && b) { @@ -10495,9 +10495,9 @@ ADE_FUNC(loadTexture, l_Graphics, "string Filename, [boolean LoadIfAnimation, bo } if(idx < 0) - return ade_set_error(L, "o", l_Texture.Set(-1)); + return ade_set_error(L, "o", l_Texture.Set(-1)); //-V510 - return ade_set_args(L, "o", l_Texture.Set(idx)); + return ade_set_args(L, "o", l_Texture.Set(idx)); //-V510 } ADE_FUNC(drawImage, l_Graphics, "string Filename/texture Texture, [number X1=0, Y1=0, number X2, number Y2, number UVX1 = 0.0, number UVY1 = 0.0, number UVX2=1.0, number UVY2=1.0, number alpha=1.0]", @@ -10534,7 +10534,7 @@ ADE_FUNC(drawImage, l_Graphics, "string Filename/texture Texture, [number X1=0, } else { - if(!ade_get_args(L, "o|iiiifffff", l_Texture.Get(&idx),&x1,&y1,&x2,&y2,&uv_x1,&uv_y1,&uv_x2,&uv_y2,&alpha)) + if(!ade_get_args(L, "o|iiiifffff", l_Texture.Get(&idx),&x1,&y1,&x2,&y2,&uv_x1,&uv_y1,&uv_x2,&uv_y2,&alpha)) //-V510 return ade_set_error(L, "b", false); } @@ -10585,7 +10585,7 @@ ADE_FUNC(drawMonochromeImage, l_Graphics, "string Filename/texture Texture, numb } else { - if(!ade_get_args(L, "oii|iif", l_Texture.Get(&idx),&x,&y,&x2,&y2,&alpha)) + if(!ade_get_args(L, "oii|iif", l_Texture.Get(&idx),&x,&y,&x2,&y2,&alpha)) //-V510 return ade_set_error(L, "b", false); } @@ -10669,14 +10669,14 @@ ADE_FUNC(loadModel, l_Graphics, "string Filename", "Loads the model - will not s int model_num = -1; if(!ade_get_args(L, "s", &s)) - return ade_set_error(L, "o", l_Model.Set(-1)); + return ade_set_error(L, "o", l_Model.Set(-1)); //-V510 if (s[0] == '\0') - return ade_set_error(L, "o", l_Model.Set(-1)); + return ade_set_error(L, "o", l_Model.Set(-1)); //-V510 model_num = model_load(s, 0, NULL); - return ade_set_args(L, "o", l_Model.Set(model_h(model_num))); + return ade_set_args(L, "o", l_Model.Set(model_h(model_num))); //-V510 } @@ -10805,7 +10805,7 @@ ADE_FUNC(getObjectFromSignature, l_Mission, "number Signature", "Gets a handle o int sig = -1; int objnum; if(!ade_get_args(L, "i", &sig)) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 objnum = obj_get_by_signature(sig); @@ -10854,13 +10854,13 @@ ADE_INDEXER(l_Mission_Asteroids, "number Index", "Gets asteroid", "asteroid", "A { int idx = -1; if( !ade_get_args(L, "*i", &idx) ) { - return ade_set_error( L, "o", l_Asteroid.Set( object_h() ) ); + return ade_set_error( L, "o", l_Asteroid.Set( object_h() ) ); //-V510 } if( idx > -1 && idx < asteroid_count() ) { - return ade_set_args( L, "o", l_Asteroid.Set( object_h( &Objects[Asteroids[idx].objnum] ), Objects[Asteroids[idx].objnum].signature ) ); + return ade_set_args( L, "o", l_Asteroid.Set( object_h( &Objects[Asteroids[idx].objnum] ), Objects[Asteroids[idx].objnum].signature ) ); //-V510 } - return ade_set_error(L, "o", l_Asteroid.Set( object_h() ) ); + return ade_set_error(L, "o", l_Asteroid.Set( object_h() ) ); //-V510 } ADE_FUNC(__len, l_Mission_Asteroids, NULL, @@ -10881,13 +10881,13 @@ ADE_INDEXER(l_Mission_Debris, "number Index", "Array of debris in the current mi { int idx = -1; if( !ade_get_args( L, "*i", &idx ) ) { - return ade_set_error(L, "o", l_Debris.Set(object_h())); + return ade_set_error(L, "o", l_Debris.Set(object_h())); //-V510 } if( idx > -1 && idx < Num_debris_pieces ) { - return ade_set_args(L, "o", l_Debris.Set(object_h(&Objects[Debris[idx].objnum]), Objects[Debris[idx].objnum].signature)); + return ade_set_args(L, "o", l_Debris.Set(object_h(&Objects[Debris[idx].objnum]), Objects[Debris[idx].objnum].signature)); //-V510 } - return ade_set_error(L, "o", l_Debris.Set(object_h())); + return ade_set_error(L, "o", l_Debris.Set(object_h())); //-V510 } ADE_FUNC(__len, l_Mission_Debris, NULL, @@ -10906,10 +10906,10 @@ ADE_INDEXER(l_Mission_EscortShips, "number Index", "Gets escort ship at specifie { int idx; if(!ade_get_args(L, "*i", &idx)) - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 if(idx < 1 || idx > hud_escort_num_ships_on_list()) - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 //Lua->FS2 idx--; @@ -10917,9 +10917,9 @@ ADE_INDEXER(l_Mission_EscortShips, "number Index", "Gets escort ship at specifie idx = hud_escort_return_objnum(idx); if(idx < 0) - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 - return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[idx]))); + return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[idx]))); //-V510 } ADE_FUNC(__len, l_Mission_EscortShips, NULL, "Current number of escort ships", "number", "Current number of escort ships") @@ -10934,24 +10934,24 @@ ADE_INDEXER(l_Mission_Events, "number Index/string Name", "Indexes events list", { char *s; if(!ade_get_args(L, "*s", &s)) - return ade_set_error(L, "o", l_Event.Set(-1)); + return ade_set_error(L, "o", l_Event.Set(-1)); //-V510 int i; for(i = 0; i < Num_mission_events; i++) { if(!stricmp(Mission_events[i].name, s)) - return ade_set_args(L, "o", l_Event.Set(i)); + return ade_set_args(L, "o", l_Event.Set(i)); //-V510 } //Now try as a number i = atoi(s); if(i < 1 || i > Num_mission_events) - return ade_set_error(L, "o", l_Event.Set(-1)); + return ade_set_error(L, "o", l_Event.Set(-1)); //-V510 //Lua-->FS2 i--; - return ade_set_args(L, "o", l_Event.Set(i)); + return ade_set_args(L, "o", l_Event.Set(i)); //-V510 } ADE_FUNC(__len, l_Mission_Events, NULL, "Number of events in mission", "number", "Number of events in mission") @@ -10967,7 +10967,7 @@ ADE_INDEXER(l_Mission_SEXPVariables, "number Index/string Name", "Array of SEXP char *name = NULL; char *newval = NULL; if(!ade_get_args(L, "*s|s", &name, &newval)) - return ade_set_error(L, "o", l_SEXPVariable.Set(sexpvar_h())); + return ade_set_error(L, "o", l_SEXPVariable.Set(sexpvar_h())); //-V510 int idx = get_index_sexp_variable_name(name); if(idx < 0) @@ -10988,7 +10988,7 @@ ADE_INDEXER(l_Mission_SEXPVariables, "number Index/string Name", "Array of SEXP //We have failed. if(idx < 0) { - return ade_set_error(L, "o", l_SEXPVariable.Set(sexpvar_h())); + return ade_set_error(L, "o", l_SEXPVariable.Set(sexpvar_h())); //-V510 } } else @@ -10999,7 +10999,7 @@ ADE_INDEXER(l_Mission_SEXPVariables, "number Index/string Name", "Array of SEXP } } - return ade_set_args(L, "o", l_SEXPVariable.Set(sexpvar_h(idx))); + return ade_set_args(L, "o", l_SEXPVariable.Set(sexpvar_h(idx))); //-V510 } ADE_FUNC(__len, l_Mission_SEXPVariables, NULL, "Current number of SEXP variables", "number", "Counts number of loaded SEXP Variables. May be slow.") @@ -11014,13 +11014,13 @@ ADE_INDEXER(l_Mission_Ships, "number Index/string Name", "Gets ship", "ship", "S { char *name; if(!ade_get_args(L, "*s", &name)) - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 int idx = ship_name_lookup(name); if(idx > -1) { - return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[Ships[idx].objnum]), Objects[Ships[idx].objnum].signature)); + return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[Ships[idx].objnum]), Objects[Ships[idx].objnum].signature)); //-V510 } else { @@ -11035,7 +11035,7 @@ ADE_INDEXER(l_Mission_Ships, "number Index/string Name", "Gets ship", "ship", "S continue; if(count == idx) { - return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[Ships[i].objnum]), Objects[Ships[i].objnum].signature)); + return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[Ships[i].objnum]), Objects[Ships[i].objnum].signature)); //-V510 } count++; @@ -11043,7 +11043,7 @@ ADE_INDEXER(l_Mission_Ships, "number Index/string Name", "Gets ship", "ship", "S } } - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 } ADE_FUNC(__len, l_Mission_Ships, NULL, @@ -11066,7 +11066,7 @@ ADE_INDEXER(l_Mission_Waypoints, "number Index", "Array of waypoints in the curr { int idx; if(!ade_get_args(L, "*i", &idx)) - return ade_set_error(L, "o", l_Waypoint.Set(object_h())); + return ade_set_error(L, "o", l_Waypoint.Set(object_h())); //-V510 //Remember, Lua indices start at 0. int count=0; @@ -11078,13 +11078,13 @@ ADE_INDEXER(l_Mission_Waypoints, "number Index", "Array of waypoints in the curr count++; if(count == idx) { - return ade_set_args(L, "o", l_Waypoint.Set(object_h(ptr))); + return ade_set_args(L, "o", l_Waypoint.Set(object_h(ptr))); //-V510 } ptr = GET_NEXT(ptr); } - return ade_set_error(L, "o", l_Weapon.Set(object_h())); + return ade_set_error(L, "o", l_Weapon.Set(object_h())); //-V510 } ADE_FUNC(__len, l_Mission_Waypoints, NULL, "Gets number of waypoints in mission. Note that this is only accurate for one frame.", "number", "Number of waypoints in the mission") @@ -11107,7 +11107,7 @@ ADE_INDEXER(l_Mission_WaypointLists, "number Index/string WaypointListName", "Ar waypointlist_h wpl; char *name; if(!ade_get_args(L, "*s", &name)) - return ade_set_error(L, "o", l_WaypointList.Set(waypointlist_h())); + return ade_set_error(L, "o", l_WaypointList.Set(waypointlist_h())); //-V510 wpl = waypointlist_h(name); @@ -11117,10 +11117,10 @@ ADE_INDEXER(l_Mission_WaypointLists, "number Index/string WaypointListName", "Ar } if (wpl.IsValid()) { - return ade_set_args(L, "o", l_WaypointList.Set(wpl)); + return ade_set_args(L, "o", l_WaypointList.Set(wpl)); //-V510 } - return ade_set_error(L, "o", l_WaypointList.Set(waypointlist_h())); + return ade_set_error(L, "o", l_WaypointList.Set(waypointlist_h())); //-V510 } ADE_FUNC(__len, l_Mission_WaypointLists, NULL, "Number of waypoint lists in mission. Note that this is only accurate for one frame.", "number", "Number of waypoint lists in the mission") @@ -11135,7 +11135,7 @@ ADE_INDEXER(l_Mission_Weapons, "number Index", "Gets handle to a weapon object i { int idx; if(!ade_get_args(L, "*i", &idx)) - return ade_set_error(L, "o", l_Weapon.Set(object_h())); + return ade_set_error(L, "o", l_Weapon.Set(object_h())); //-V510 //Remember, Lua indices start at 0. int count=1; @@ -11146,13 +11146,13 @@ ADE_INDEXER(l_Mission_Weapons, "number Index", "Gets handle to a weapon object i continue; if(count == idx) { - return ade_set_args(L, "o", l_Weapon.Set(object_h(&Objects[Weapons[i].objnum]))); + return ade_set_args(L, "o", l_Weapon.Set(object_h(&Objects[Weapons[i].objnum]))); //-V510 } count++; } - return ade_set_error(L, "o", l_Weapon.Set(object_h())); + return ade_set_error(L, "o", l_Weapon.Set(object_h())); //-V510 } ADE_FUNC(__len, l_Mission_Weapons, NULL, "Number of weapon objects in mission. Note that this is only accurate for one frame.", "number", "Number of weapon objects in mission") { @@ -11166,7 +11166,7 @@ ADE_INDEXER(l_Mission_Beams, "number Index", "Gets handle to a beam object in th { int idx; if(!ade_get_args(L, "*i", &idx)) - return ade_set_error(L, "o", l_Beam.Set(object_h())); + return ade_set_error(L, "o", l_Beam.Set(object_h())); //-V510 //Remember, Lua indices start at 0. int count=1; @@ -11177,13 +11177,13 @@ ADE_INDEXER(l_Mission_Beams, "number Index", "Gets handle to a beam object in th continue; if(count == idx) { - return ade_set_args(L, "o", l_Beam.Set(object_h(&Objects[Beams[i].objnum]))); + return ade_set_args(L, "o", l_Beam.Set(object_h(&Objects[Beams[i].objnum]))); //-V510 } count++; } - return ade_set_error(L, "o", l_Beam.Set(object_h())); + return ade_set_error(L, "o", l_Beam.Set(object_h())); //-V510 } ADE_FUNC(__len, l_Mission_Beams, NULL, "Number of beam objects in mission. Note that this is only accurate for one frame.", "number", "Number of beam objects in mission") { @@ -11197,7 +11197,7 @@ ADE_INDEXER(l_Mission_Wings, "number Index/string WingName", "Wings in the missi { char *name; if(!ade_get_args(L, "*s", &name)) - return ade_set_error(L, "o", l_Wing.Set(-1)); + return ade_set_error(L, "o", l_Wing.Set(-1)); //-V510 int idx = wing_name_lookup(name); @@ -11205,12 +11205,12 @@ ADE_INDEXER(l_Mission_Wings, "number Index/string WingName", "Wings in the missi { idx = atoi(name); if(idx < 1 || idx > Num_wings) - return ade_set_error(L, "o", l_Wing.Set(-1)); + return ade_set_error(L, "o", l_Wing.Set(-1)); //-V510 idx--; //Lua->FS2 } - return ade_set_args(L, "o", l_Wing.Set(idx)); + return ade_set_args(L, "o", l_Wing.Set(idx)); //-V510 } ADE_FUNC(__len, l_Mission_Wings, NULL, "Number of wings in mission", "number", "Number of wings in mission") @@ -11224,7 +11224,7 @@ ADE_FUNC(createShip, l_Mission, "[string Name, shipclass Class=Shipclass[1], ori int sclass = -1; matrix_h *orient = NULL; vec3d pos = vmd_zero_vector; - ade_get_args(L, "|sooo", &name, l_Shipclass.Get(&sclass), l_Matrix.GetPtr(&orient), l_Vector.Get(&pos)); + ade_get_args(L, "|sooo", &name, l_Shipclass.Get(&sclass), l_Matrix.GetPtr(&orient), l_Vector.Get(&pos)); //-V510 matrix *real_orient = &vmd_identity_matrix; if(orient != NULL) @@ -11235,9 +11235,9 @@ ADE_FUNC(createShip, l_Mission, "[string Name, shipclass Class=Shipclass[1], ori int obj_idx = ship_create(real_orient, &pos, sclass, name); if(obj_idx > -1) - return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[obj_idx]), Objects[obj_idx].signature)); + return ade_set_args(L, "o", l_Ship.Set(object_h(&Objects[obj_idx]), Objects[obj_idx].signature)); //-V510 else - return ade_set_error(L, "o", l_Ship.Set(object_h())); + return ade_set_error(L, "o", l_Ship.Set(object_h())); //-V510 } ADE_FUNC(createWaypoint, l_Mission, "[vector Position, waypointlist List]", @@ -11247,8 +11247,8 @@ ADE_FUNC(createWaypoint, l_Mission, "[vector Position, waypointlist List]", { vec3d *v3 = NULL; waypointlist_h *wlh = NULL; - if(!ade_get_args(L, "|oo", l_Vector.GetPtr(&v3), l_WaypointList.GetPtr(&wlh))) - return ade_set_error(L, "o", l_Waypoint.Set(object_h())); + if(!ade_get_args(L, "|oo", l_Vector.GetPtr(&v3), l_WaypointList.GetPtr(&wlh))) //-V510 + return ade_set_error(L, "o", l_Waypoint.Set(object_h())); //-V510 // determine where we need to create it - it looks like we were given a waypoint list but not a waypoint itself int waypoint_instance = -1; @@ -11261,9 +11261,9 @@ ADE_FUNC(createWaypoint, l_Mission, "[vector Position, waypointlist List]", int obj_idx = waypoint_add(v3 != NULL ? v3 : &vmd_zero_vector, waypoint_instance); if(obj_idx >= 0) - return ade_set_args(L, "o", l_Waypoint.Set(object_h(&Objects[obj_idx]))); + return ade_set_args(L, "o", l_Waypoint.Set(object_h(&Objects[obj_idx]))); //-V510 else - return ade_set_args(L, "o", l_Waypoint.Set(object_h())); + return ade_set_args(L, "o", l_Waypoint.Set(object_h())); //-V510 } ADE_FUNC(createWeapon, l_Mission, "[weaponclass Class=WeaponClass[1], orientation Orientation=null, world vector Position={0,0,0}, object Parent = nil, number Group = -1", @@ -11277,7 +11277,7 @@ ADE_FUNC(createWeapon, l_Mission, "[weaponclass Class=WeaponClass[1], orientatio int group = -1; matrix_h *orient = NULL; vec3d pos = vmd_zero_vector; - ade_get_args(L, "|ooooi", l_Weaponclass.Get(&wclass), l_Matrix.GetPtr(&orient), l_Vector.Get(&pos), l_Object.GetPtr(&parent), &group); + ade_get_args(L, "|ooooi", l_Weaponclass.Get(&wclass), l_Matrix.GetPtr(&orient), l_Vector.Get(&pos), l_Object.GetPtr(&parent), &group); //-V510 matrix *real_orient = &vmd_identity_matrix; if(orient != NULL) @@ -11290,9 +11290,9 @@ ADE_FUNC(createWeapon, l_Mission, "[weaponclass Class=WeaponClass[1], orientatio int obj_idx = weapon_create(&pos, real_orient, wclass, parent_idx, group); if(obj_idx > -1) - return ade_set_args(L, "o", l_Weapon.Set(object_h(&Objects[obj_idx]), Objects[obj_idx].signature)); + return ade_set_args(L, "o", l_Weapon.Set(object_h(&Objects[obj_idx]), Objects[obj_idx].signature)); //-V510 else - return ade_set_error(L, "o", l_Weapon.Set(object_h())); + return ade_set_error(L, "o", l_Weapon.Set(object_h())); //-V510 } ADE_FUNC(getMissionFilename, l_Mission, NULL, "Gets mission filename", "string", "Mission filename, or empty string if game is not in a mission") @@ -11317,7 +11317,7 @@ ADE_FUNC(startMission, l_Mission, "[Filename or MISSION_* enumeration, Briefing } else { enum_h *e = NULL; - if (!ade_get_args(L, "o|b", l_Enum.GetPtr(&e), &b)) + if (!ade_get_args(L, "o|b", l_Enum.GetPtr(&e), &b)) //-V510 return ade_set_args(L, "b", false); if (e->index == LE_MISSION_REPEAT) { @@ -11525,23 +11525,23 @@ ade_lib l_Tables_ShipClasses("ShipClasses", &l_Tables, NULL, NULL); ADE_INDEXER(l_Tables_ShipClasses, "number Index/string Name", "Array of ship classes", "ship", "Ship handle, or invalid ship handle if index is invalid") { if(!ships_inited) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 char *name; if(!ade_get_args(L, "*s", &name)) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 int idx = ship_info_lookup(name); if(idx < 0) { idx = atoi(name); if(idx < 1 || idx > Num_ship_classes) - return ade_set_error(L, "o", l_Shipclass.Set(-1)); + return ade_set_error(L, "o", l_Shipclass.Set(-1)); //-V510 idx--; //Lua->FS2 } - return ade_set_args(L, "o", l_Shipclass.Set(idx)); + return ade_set_args(L, "o", l_Shipclass.Set(idx)); //-V510 } ADE_FUNC(__len, l_Tables_ShipClasses, NULL, "Number of ship classes", "number", "Number of ship classes, or 0 if ship classes haven't been loaded yet") @@ -11560,7 +11560,7 @@ extern int Weapons_inited; ADE_INDEXER(l_Tables_WeaponClasses, "number Index/string WeaponName", "Array of weapon classes", "weapon", "Weapon class handle, or invalid weaponclass handle if index is invalid") { if(!Weapons_inited) - return ade_set_error(L, "o", l_Weaponclass.Set(-1)); + return ade_set_error(L, "o", l_Weaponclass.Set(-1)); //-V510 char *name; if(!ade_get_args(L, "*s", &name)) @@ -11572,11 +11572,11 @@ ADE_INDEXER(l_Tables_WeaponClasses, "number Index/string WeaponName", "Array of idx = atoi(name); if(idx < 1 || idx > Num_weapon_types) { - return ade_set_args(L, "o", l_Weaponclass.Set(-1)); + return ade_set_args(L, "o", l_Weaponclass.Set(-1)); //-V510 } } - return ade_set_args(L, "o", l_Weaponclass.Set(idx)); + return ade_set_args(L, "o", l_Weaponclass.Set(idx)); //-V510 } ADE_FUNC(__len, l_Tables_WeaponClasses, NULL, "Number of weapon classes", "number", "Number of weapon classes, or 0 if weapon classes haven't been loaded yet") @@ -11637,7 +11637,7 @@ ADE_FUNC(createParticle, l_Testing, "vector Position, vector Velocity, number Li enum_h *type = NULL; bool rev=false; object_h *objh=NULL; - if(!ade_get_args(L, "ooffo|fboo", l_Vector.Get(&pi.pos), l_Vector.Get(&pi.vel), &pi.lifetime, &pi.rad, l_Enum.GetPtr(&type), &pi.tracer_length, &rev, l_Texture.Get((int*)&pi.optional_data), l_Object.GetPtr(&objh))) + if(!ade_get_args(L, "ooffo|fboo", l_Vector.Get(&pi.pos), l_Vector.Get(&pi.vel), &pi.lifetime, &pi.rad, l_Enum.GetPtr(&type), &pi.tracer_length, &rev, l_Texture.Get((int*)&pi.optional_data), l_Object.GetPtr(&objh))) //-V510 return ADE_RETURN_NIL; if(type != NULL) @@ -11679,7 +11679,7 @@ ADE_FUNC(createParticle, l_Testing, "vector Position, vector Velocity, number Li particle *p = particle_create(&pi); if (p != NULL) - return ade_set_args(L, "o", l_Particle.Set(particle_h(p))); + return ade_set_args(L, "o", l_Particle.Set(particle_h(p))); //-V510 else return ADE_RETURN_NIL; } @@ -11722,24 +11722,24 @@ ADE_FUNC(isPXOEnabled, l_Testing, NULL, "Returns whether PXO is currently enable int ade_set_object_with_breed(lua_State *L, int obj_idx) { if(obj_idx < 0 || obj_idx > MAX_OBJECTS) - return ade_set_error(L, "o", l_Object.Set(object_h())); + return ade_set_error(L, "o", l_Object.Set(object_h())); //-V510 object *objp = &Objects[obj_idx]; switch(objp->type) { case OBJ_SHIP: - return ade_set_args(L, "o", l_Ship.Set(object_h(objp))); + return ade_set_args(L, "o", l_Ship.Set(object_h(objp))); //-V510 case OBJ_ASTEROID: - return ade_set_args(L, "o", l_Asteroid.Set(object_h(objp))); + return ade_set_args(L, "o", l_Asteroid.Set(object_h(objp))); //-V510 case OBJ_DEBRIS: - return ade_set_args(L, "o", l_Debris.Set(object_h(objp))); + return ade_set_args(L, "o", l_Debris.Set(object_h(objp))); //-V510 case OBJ_WAYPOINT: - return ade_set_args(L, "o", l_Waypoint.Set(object_h(objp))); + return ade_set_args(L, "o", l_Waypoint.Set(object_h(objp))); //-V510 case OBJ_WEAPON: - return ade_set_args(L, "o", l_Weapon.Set(object_h(objp))); + return ade_set_args(L, "o", l_Weapon.Set(object_h(objp))); //-V510 default: - return ade_set_args(L, "o", l_Object.Set(object_h(objp))); + return ade_set_args(L, "o", l_Object.Set(object_h(objp))); //-V510 } } @@ -11881,7 +11881,7 @@ int script_state::CreateLuaState() eh.index = Enumerations[i].def; eh.is_constant = true; - ade_set_args(L, "o", l_Enum.Set(eh)); + ade_set_args(L, "o", l_Enum.Set(eh)); //-V510 lua_setglobal(L, Enumerations[i].name); } @@ -12645,7 +12645,7 @@ int ade_table_entry::SetTable(lua_State *L, int p_amt_ldx, int p_mtb_ldx) default: char typestr[2] = {Type, '\0'}; - nset = ade_set_args(L, typestr, Value); + nset = ade_set_args(L, typestr, Value); //-V510 break; }