diff --git a/src/p_3dmidtex.cpp b/src/p_3dmidtex.cpp index 4bb9ec4ba6..d04decfa03 100644 --- a/src/p_3dmidtex.cpp +++ b/src/p_3dmidtex.cpp @@ -236,7 +236,7 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, do double textureheight = tex->GetHeight() / totalscale; if (totalscale != 1. && !tex->bWorldPanning) { - y_offset *= totalscale; + y_offset /= totalscale; } if(line->flags & ML_DONTPEGBOTTOM) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 00b3229b22..c880d87bf6 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -8637,8 +8637,11 @@ scriptwait: else { item = activator->GiveInventoryType (static_cast(type)); - item->MaxAmount = STACK(1); - item->Amount = 0; + if (item != NULL) + { + item->MaxAmount = STACK(1); + item->Amount = 0; + } } } } diff --git a/src/p_map.cpp b/src/p_map.cpp index 5d01f7af2e..76d083537c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5002,7 +5002,7 @@ bool P_UsePuzzleItem(AActor *PuzzleItemUser, int PuzzleItemType) start = PuzzleItemUser->GetPortalTransition(PuzzleItemUser->Height / 2); end = PuzzleItemUser->Angles.Yaw.ToVector(usedist); - FPathTraverse it(start.X, start.Y, end.X, end.Y, PT_ADDLINES | PT_ADDTHINGS); + FPathTraverse it(start.X, start.Y, end.X, end.Y, PT_DELTA | PT_ADDLINES | PT_ADDTHINGS); intercept_t *in; while ((in = it.Next())) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index d1fee071e5..ac4dbc78fd 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -773,7 +773,7 @@ static void CalcSectorSoundOrg(const DVector3 &listenpos, const sector_t *sec, i if (!(i_compatflags & COMPATF_SECTORSOUNDS)) { // Are we inside the sector? If yes, the closest point is the one we're on. - if (P_PointInSector(pos.X, pos.Y) == sec) + if (P_PointInSector(listenpos.X, listenpos.Y) == sec) { pos.X = (float)listenpos.X; pos.Z = (float)listenpos.Y; diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 89fe947578..b0db481a89 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -1165,7 +1165,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part, bool silent, i else if (sc.Compare("alpha")) { sc.MustGetFloat(); - part.Alpha = clamp(int(sc.Float / BLENDUNIT), 0, BLENDUNIT); + part.Alpha = clamp(int(sc.Float * BLENDUNIT), 0, BLENDUNIT); // bComplex is not set because it is only needed when the style is not OP_COPY. } else if (sc.Compare("style")) diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index 802a4d9e8e..4603fb4f98 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -542,7 +542,7 @@ static DWORD WINAPI WriteMiniDumpInAnotherThread (LPVOID lpParam) // //========================================================================== -void __cdecl Writef (HANDLE file, const char *format, ...) +void Writef (HANDLE file, const char *format, ...) { char buffer[1024]; va_list args; diff --git a/tools/zipdir/zipdir.c b/tools/zipdir/zipdir.c index e21b9ba13b..cee41b12ed 100644 --- a/tools/zipdir/zipdir.c +++ b/tools/zipdir/zipdir.c @@ -56,10 +56,6 @@ // MACROS ------------------------------------------------------------------ -#ifndef _WIN32 -#define __cdecl -#endif - #ifdef __GNUC__ // With versions of GCC newer than 4.2, it appears it was determined that the // cost of an unaligned pointer on PPC was high enough to add padding to the @@ -212,7 +208,7 @@ dir_tree_t *add_dir(const char *dirpath); #endif dir_tree_t *add_dirs(char **argv); int count_files(dir_tree_t *trees); -int __cdecl sort_cmp(const void *a, const void *b); +int sort_cmp(const void *a, const void *b); file_sorted_t *sort_files(dir_tree_t *trees, int num_files); void write_zip(const char *zipname, dir_tree_t *trees, int update); int append_to_zip(FILE *zip_file, file_sorted_t *file, FILE *ozip, BYTE *odir); @@ -694,7 +690,7 @@ int count_files(dir_tree_t *trees) // //========================================================================== -int __cdecl sort_cmp(const void *a, const void *b) +int sort_cmp(const void *a, const void *b) { const file_sorted_t *sort1 = (const file_sorted_t *)a; const file_sorted_t *sort2 = (const file_sorted_t *)b; @@ -1569,7 +1565,7 @@ int copy_zip_file(FILE *zip, file_entry_t *file, FILE *ozip, CentralDirectoryEnt // //========================================================================== -int __cdecl main (int argc, char **argv) +int main (int argc, char **argv) { dir_tree_t *tree, *trees; file_entry_t *file;