enigma-dev/enigma-dev — pull request #808 by sorlok (2014-08-25 17:30:24+00:00)
Title: Fix for bad polygons crashing the game.

The draw_polygon_begin()/vertext()/end() code (which is ONLY used from the GM5 compat plugin, but is accessible globally) will crash if you define a polygon with multiple consecutive points the same. For example:
https://drive.google.com/file/d/0B1P7NepPcOslekJxMTRNdHpsWTA

The tessellation algorithm is working correctly; it just returns a null pointer and a 0 weight if the edge in question has no effect on the total shape. This patch accounts for that that and fixes the bug; shapes now display properly and, more importantly, the game won't segfault if you define bogus polygons.

This also fixes a crash in the final boss on Iji.