~vcs-imports/openc2e/trunk

« back to all changes in this revision

Viewing changes to caosVM_map.cpp

  • Committer: fuzzie
  • Date: 2008-04-30 22:49:39 UTC
  • Revision ID: vcs-imports@canonical.com-20080430224939-2loq0z1qtf2bi6ql
maybe implement FLOR

Show diffs side-by-side

added added

removed removed

Lines of Context:
980
980
 
981
981
/**
982
982
 FLOR (integer)
983
 
 %status stub
 
983
 %status maybe
984
984
 %pragma variants c2
985
985
 
986
986
 Return y coordinate of floor below centre of target agent.
988
988
void caosVM::v_FLOR() {
989
989
        valid_agent(targ);
990
990
 
991
 
        result.setInt(0); // TODO
 
991
        shared_ptr<Room> r = roomContainingAgent(targ);
 
992
        if (!r)
 
993
                result.setInt(0); // TODO
 
994
        else
 
995
                result.setInt(r->floorYatX(targ->x + (targ->getWidth() / 2.0f)));
992
996
}
993
997
 
994
998
/**
1012
1016
void caosVM::v_GRND() {
1013
1017
        VM_PARAM_INTEGER(index)
1014
1018
 
1015
 
        caos_assert(index >= 0 && index < world.groundlevels.size());
 
1019
        caos_assert(index >= 0 && (unsigned int)index < world.groundlevels.size());
1016
1020
 
1017
1021
        result.setInt(world.groundlevels[index]);
1018
1022
}