1. Список говнокодов пользователя int0x18

    Всего: 1

  2. C++ / Говнокод #18037

    +145

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    void* PhysicsWorld::CreateBodyImpl(const PhysicsBodyCInfo& bodyInfo)
    {
    	void* pBody = 0;
    	PhysicsBody* body = 0;
    
    	switch(bodyInfo.GetType())
    	{
    		case PHYSICS_BODY:
    			pBody = new PhysicsKovahBody(this);
    			// This one is special and I dont know why. I used AddToWatch1 to get this std::string well casted.
    			body = (PhysicsBody*)(&(*(PhysicsKovahRigidBody*)(&*((PhysicsKovahBody*)pBody))));
    			pBody = body;
    			break;
    		case PHYSICS_CHARACTER_BODY:
    			pBody = new PhysicsKovahCharacterBody(this);
    			body = (PhysicsBody*)((PhysicsCharacterBody*)pBody);
    			break;
    		case PHYSICS_CAR_BODY:
    			pBody = new PhysicsKovahCarBody(this);
    			body = (PhysicsBody*)((PhysicsCarBody*)pBody);
    			break;
    		case PHYSICS_MOTO_BODY:
    			pBody = new PhysicsKovahMotoBody(this);
    			body = (PhysicsBody*)((PhysicsMotoBody*)pBody);
    			break;
    		case PHYSICS_BOAT_BODY:
    			pBody = new PhysicsKovahBoatBody(this);
    			body = (PhysicsBody*)((PhysicsBoatBody*)pBody);
    			break;
    		case PHYSICS_AIRPLANE_BODY:
    			pBody = new PhysicsKovahAirplaneBody(this);
    			body = (PhysicsBody*)(&(*(PhysicsVehicleBody*)(&(*(PhysicsAirplaneBody*)(&*((PhysicsKovahAirplaneBody*)pBody))))));
    			break;
    		case PHYSICS_HELICOPTER_BODY:
    			pBody = new PhysicsKovahHelicopterBody(this);
    			body = (PhysicsBody*)(&(*(PhysicsVehicleBody*)(&(*(PhysicsHelicopterBody*)(&*((PhysicsKovahHelicopterBody*)pBody))))));
    			break;
    		case PHYSICS_JETPACK_BODY:
    			pBody = new PhysicsKovahJetpackBody(this);
    			body = (PhysicsBody*)(&(*(PhysicsVehicleBody*)(&(*(PhysicsJetpackBody*)(&*((PhysicsKovahJetpackBody*)pBody))))));
    			break;
    		case PHYSICS_VTOL_BODY:
    			pBody = new PhysicsKovahVTOLBody(this);
    			body = (PhysicsBody*)(&(*(PhysicsVehicleBody*)(&(*(PhysicsVTOLBody*)(&*((PhysicsKovahVTOLBody*)pBody))))));
    			break;
    		case PHYSICS_CAMERA_BODY:
    			break;
    	};
    
    	if(body && body->Create(bodyInfo))
    	{
    		return pBody;
    	}
    	SafeDelete(body);
    	return 0;
    }

    int0x18, 21 Апреля 2015

    Комментарии (7)