diff --git a/src/elements/prti.c b/src/elements/prti.c index 2b08aae50..5c34cf9fb 100644 --- a/src/elements/prti.c +++ b/src/elements/prti.c @@ -42,10 +42,10 @@ int update_PRTI(UPDATE_FUNC_ARGS) { if(fe){ - if(!parts[i].life) parts[i].life = rand(); - if(!parts[i].ctype) parts[i].life = rand(); int orbd[4] = {0, 0, 0, 0}; //Orbital distances int orbl[4] = {0, 0, 0, 0}; //Orbital locations + if(!parts[i].life) parts[i].life = rand(); + if(!parts[i].ctype) parts[i].life = rand(); orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl); for(r = 0; r < 4; r++){ if(orbd[r]>1){ diff --git a/src/elements/prto.c b/src/elements/prto.c index adf82a75c..40cf97c56 100644 --- a/src/elements/prto.c +++ b/src/elements/prto.c @@ -63,10 +63,10 @@ int update_PRTO(UPDATE_FUNC_ARGS) { } } if(fe){ - if(!parts[i].life) parts[i].life = rand(); - if(!parts[i].ctype) parts[i].life = rand(); int orbd[4] = {0, 0, 0, 0}; //Orbital distances int orbl[4] = {0, 0, 0, 0}; //Orbital locations + if(!parts[i].life) parts[i].life = rand(); + if(!parts[i].ctype) parts[i].life = rand(); orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl); for(r = 0; r < 4; r++){ if(orbd[r]<254){ diff --git a/src/main.c b/src/main.c index 0bbbd7331..a722c16f4 100644 --- a/src/main.c +++ b/src/main.c @@ -1324,45 +1324,48 @@ static PyObject* emb_console_less(PyObject *self, PyObject *args) static PyObject* emb_reset_pressure(PyObject *self, PyObject *args) { - if(!PyArg_ParseTuple(args, ":reset_pressure")) - return NULL; - // - for (int nx = 0; nx +#endif //Signum function #if defined(WIN32) && !defined(__GNUC__) @@ -403,16 +406,17 @@ int register_extension() { #if defined INSTALLABLE #if defined WIN32 - LONG rresult; HKEY newkey; - char *currentfilename; + char currentfilename[MAX_PATH] = ""; char *iconname; char *opencommand; - currentfilename = exe_name(); - iconname = malloc(strlen(currentfilename)+3); + if (!GetModuleFileName(NULL, currentfilename, MAX_PATH)) + return 0; + currentfilename[MAX_PATH-1] = 0; + iconname = malloc(strlen(currentfilename)+6); opencommand = malloc(strlen(currentfilename)+13); - sprintf(iconname, "%s,1", currentfilename); + sprintf(iconname, "%s,-101", currentfilename); sprintf(opencommand, "\"%s\" open:\"%%1\"", currentfilename); //Create extension entry