LeBron James may be the star of the Miami Heat, but it turns out that playing basketball in the heat causes him to melt down.

Last night, an electrical system power failure at the AT&T Center in San Antonio knocked out the air conditioning during game 1 of the NBA Finals, sending temperatures in the stadium soaring to over 90 degrees. With just a few minutes left in the game, James clutched his leg and grimaced and had to be carried off the court. The cause: a thigh cramp. The Heat lost to the San Antonio Spurs, 110-95.

The Washington Post reports that sports fans on Twitter showed no mercy for James, calling him "soft" and comparing him to Michael Jordan, who scored 39 points for the Chicago Bulls in the 1997 NBA Finals while battling the flu. But the truth is, muscle cramps are a form of heat illness, and it's no laughing matter.

Heat cramps occur when your body loses too much salt from sweat. Heat cramps can lead to heat exhaustion (caused by dehydration), and that can progress into heatstroke, the most serious form of heat illness. Heat is the top weather-related killer in the United States, accounting for about 700 deaths a year.

As temperatures begin to creep up this summer, keep James in mind as a cautionary tale to stay safe while working out in the heat. The American Council on Exercise offers the following guidelines:

Drink up
About 30 minutes before you start your workout, drink a full glass of water. Then, sip at least six ounces every 20 minutes during your sweat session. Going for an hour or more? Switch to a sports drink for the electrolytes.

Slow down
Be flexible with your workout plans: if you were planning a high-intensity interval workout on a day that turns out to be 95 degrees, save it for a cooler day.

Dress right
Wear wicking fabrics to help prevent sweat from sticking to your body.

MORE: 12 Ways to Stay Active When it's Too Hot to Work Out